Unnamed: 0
int64
0
60k
input
stringlengths
76
562
answer
stringlengths
18
557
2,100
<question>: What is the average rating of songs for each language? <context>: CREATE TABLE song (languages VARCHAR, rating INTEGER)
SELECT AVG(rating), languages FROM song GROUP BY languages
2,101
<question>: Return the gender and name of artist who produced the song with the lowest resolution. <context>: CREATE TABLE artist (gender VARCHAR, artist_name VARCHAR); CREATE TABLE song (artist_name VARCHAR, resolution VARCHAR)
SELECT T1.gender, T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1
2,102
<question>: For each file format, return the number of artists who released songs in that format. <context>: CREATE TABLE files (formats VARCHAR)
SELECT COUNT(*), formats FROM files GROUP BY formats
2,103
<question>: Find the distinct names of all songs that have a higher resolution than some songs in English. <context>: CREATE TABLE song (song_name VARCHAR, resolution INTEGER, languages VARCHAR)
SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT MIN(resolution) FROM song WHERE languages = "english")
2,104
<question>: What are the names of all songs that have a lower rating than some song of blues genre? <context>: CREATE TABLE song (song_name VARCHAR, rating INTEGER, genre_is VARCHAR)
SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = "blues")
2,105
<question>: What is the name and country of origin of the artist who released a song that has "love" in its title? <context>: CREATE TABLE song (artist_name VARCHAR, song_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)
SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE "%love%"
2,106
<question>: List the name and gender for all artists who released songs in March. <context>: CREATE TABLE song (artist_name VARCHAR, releasedate VARCHAR); CREATE TABLE artist (artist_name VARCHAR, gender VARCHAR)
SELECT T1.artist_name, T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE "%Mar%"
2,107
<question>: List the names of all genres in alphabetical oder, together with its ratings. <context>: CREATE TABLE genre (g_name VARCHAR, rating VARCHAR)
SELECT g_name, rating FROM genre ORDER BY g_name
2,108
<question>: Give me a list of the names of all songs ordered by their resolution. <context>: CREATE TABLE song (song_name VARCHAR, resolution VARCHAR)
SELECT song_name FROM song ORDER BY resolution
2,109
<question>: What are the ids of songs that are available in either mp4 format or have resolution above 720? <context>: CREATE TABLE song (f_id VARCHAR, formats VARCHAR, resolution INTEGER); CREATE TABLE files (f_id VARCHAR, formats VARCHAR, resolution INTEGER)
SELECT f_id FROM files WHERE formats = "mp4" UNION SELECT f_id FROM song WHERE resolution > 720
2,110
<question>: List the names of all songs that have 4 minute duration or are in English. <context>: CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (song_name VARCHAR, f_id VARCHAR); CREATE TABLE song (song_name VARCHAR, languages VARCHAR)
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages = "english"
2,111
<question>: What is the language used most often in the songs? <context>: CREATE TABLE song (languages VARCHAR)
SELECT languages FROM song GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1
2,112
<question>: What is the language that was used most often in songs with resolution above 500? <context>: CREATE TABLE song (artist_name VARCHAR, languages VARCHAR, resolution INTEGER)
SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1
2,113
<question>: What are the names of artists who are Male and are from UK? <context>: CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, gender VARCHAR)
SELECT artist_name FROM artist WHERE country = "UK" AND gender = "Male"
2,114
<question>: Find the names of songs whose genre is modern or language is English. <context>: CREATE TABLE song (song_name VARCHAR, genre_is VARCHAR, languages VARCHAR)
SELECT song_name FROM song WHERE genre_is = "modern" OR languages = "english"
2,115
<question>: Return the names of songs for which format is mp3 and resolution is below 1000. <context>: CREATE TABLE song (song_name VARCHAR, resolution INTEGER); CREATE TABLE song (song_name VARCHAR, f_id VARCHAR); CREATE TABLE files (f_id VARCHAR, formats VARCHAR)
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3" INTERSECT SELECT song_name FROM song WHERE resolution < 1000
2,116
<question>: Return the names of singers who are from UK and released an English song. <context>: CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)
SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "english"
2,117
<question>: What are the average rating and resolution of songs that are in Bangla? <context>: CREATE TABLE song (rating INTEGER, resolution INTEGER, languages VARCHAR)
SELECT AVG(rating), AVG(resolution) FROM song WHERE languages = "bangla"
2,118
<question>: What are the maximum and minimum resolution of songs whose duration is 3 minutes? <context>: CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (resolution INTEGER, f_id VARCHAR)
SELECT MAX(T2.resolution), MIN(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "3:%"
2,119
<question>: What are the maximum duration and resolution of songs grouped and ordered by languages? <context>: CREATE TABLE song (languages VARCHAR, resolution INTEGER, f_id VARCHAR); CREATE TABLE files (duration INTEGER, f_id VARCHAR)
SELECT MAX(T1.duration), MAX(T2.resolution), T2.languages FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.languages ORDER BY T2.languages
2,120
<question>: What are the shortest duration and lowest rating of songs grouped by genre and ordered by genre? <context>: CREATE TABLE song (genre_is VARCHAR, rating INTEGER, f_id VARCHAR); CREATE TABLE files (duration INTEGER, f_id VARCHAR)
SELECT MIN(T1.duration), MIN(T2.rating), T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is
2,121
<question>: Find the names and number of works of all artists who have at least one English songs. <context>: CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR)
SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "english" GROUP BY T2.artist_name HAVING COUNT(*) >= 1
2,122
<question>: Find the name and country of origin for all artists who have release at least one song of resolution above 900. <context>: CREATE TABLE song (artist_name VARCHAR, resolution INTEGER); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)
SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.resolution > 900 GROUP BY T2.artist_name HAVING COUNT(*) >= 1
2,123
<question>: Find the names and number of works of the three artists who have produced the most songs. <context>: CREATE TABLE song (artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR)
SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3
2,124
<question>: Find the country of origin for the artist who made the least number of songs? <context>: CREATE TABLE song (artist_name VARCHAR); CREATE TABLE artist (country VARCHAR, artist_name VARCHAR)
SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT(*) LIMIT 1
2,125
<question>: What are the names of the songs whose rating is below the rating of all songs in English? <context>: CREATE TABLE song (song_name VARCHAR, rating INTEGER, languages VARCHAR)
SELECT song_name FROM song WHERE rating < (SELECT MIN(rating) FROM song WHERE languages = 'english')
2,126
<question>: What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8? <context>: CREATE TABLE song (f_id VARCHAR, resolution INTEGER, rating INTEGER)
SELECT f_id FROM song WHERE resolution > (SELECT MAX(resolution) FROM song WHERE rating < 8)
2,127
<question>: What is ids of the songs whose resolution is higher than the average resolution of songs in modern genre? <context>: CREATE TABLE song (f_id VARCHAR, resolution INTEGER, genre_is VARCHAR)
SELECT f_id FROM song WHERE resolution > (SELECT AVG(resolution) FROM song WHERE genre_is = "modern")
2,128
<question>: Find the top 3 artists who have the largest number of songs works whose language is Bangla. <context>: CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR)
SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "bangla" GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3
2,129
<question>: List the id, genre and artist name of English songs ordered by rating. <context>: CREATE TABLE song (f_id VARCHAR, genre_is VARCHAR, artist_name VARCHAR, languages VARCHAR, rating VARCHAR)
SELECT f_id, genre_is, artist_name FROM song WHERE languages = "english" ORDER BY rating
2,130
<question>: List the duration, file size and format of songs whose genre is pop, ordered by title? <context>: CREATE TABLE song (f_id VARCHAR, genre_is VARCHAR, song_name VARCHAR); CREATE TABLE files (duration VARCHAR, file_size VARCHAR, formats VARCHAR, f_id VARCHAR)
SELECT T1.duration, T1.file_size, T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.genre_is = "pop" ORDER BY T2.song_name
2,131
<question>: Find the names of the artists who have produced English songs but have never received rating higher than 8. <context>: CREATE TABLE song (artist_name VARCHAR, languages VARCHAR, rating INTEGER)
SELECT DISTINCT artist_name FROM song WHERE languages = "english" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8
2,132
<question>: Find the names of the artists who are from Bangladesh and have never received rating higher than 7. <context>: CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, rating INTEGER); CREATE TABLE song (artist_name VARCHAR, country VARCHAR, rating INTEGER)
SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7
2,133
<question>: what is the full name and id of the college with the largest number of baseball players? <context>: CREATE TABLE player_college (college_id VARCHAR); CREATE TABLE college (name_full VARCHAR, college_id VARCHAR)
SELECT T1.name_full, T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id = T2.college_id GROUP BY T1.college_id ORDER BY COUNT(*) DESC LIMIT 1
2,134
<question>: What is average salary of the players in the team named 'Boston Red Stockings' ? <context>: CREATE TABLE salary (salary INTEGER, team_id VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)
SELECT AVG(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'
2,135
<question>: What are first and last names of players participating in all star game in 1998? <context>: CREATE TABLE all_star (player_id VARCHAR); CREATE TABLE player (player_id VARCHAR)
SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998
2,136
<question>: What are the first name, last name and id of the player with the most all star game experiences? Also list the count. <context>: CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE all_star (player_id VARCHAR)
SELECT T1.name_first, T1.name_last, T1.player_id, COUNT(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 1
2,137
<question>: How many players enter hall of fame each year? <context>: CREATE TABLE hall_of_fame (yearid VARCHAR)
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid
2,138
<question>: What is the average number of attendance at home games for each year? <context>: CREATE TABLE home_game (YEAR VARCHAR, attendance INTEGER)
SELECT YEAR, AVG(attendance) FROM home_game GROUP BY YEAR
2,139
<question>: In 2014, what are the id and rank of the team that has the largest average number of attendance? <context>: CREATE TABLE team (team_id VARCHAR, rank VARCHAR); CREATE TABLE home_game (team_id VARCHAR, year VARCHAR, attendance INTEGER)
SELECT T2.team_id, T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id WHERE T1.year = 2014 GROUP BY T1.team_id ORDER BY AVG(T1.attendance) DESC LIMIT 1
2,140
<question>: What are the manager's first name, last name and id who won the most manager award? <context>: CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE manager_award (player_id VARCHAR)
SELECT T1.name_first, T1.name_last, T2.player_id FROM player AS T1 JOIN manager_award AS T2 ON T1.player_id = T2.player_id GROUP BY T2.player_id ORDER BY COUNT(*) DESC LIMIT 1
2,141
<question>: How many parks are there in the state of NY? <context>: CREATE TABLE park (state VARCHAR)
SELECT COUNT(*) FROM park WHERE state = 'NY'
2,142
<question>: Which 3 players won the most player awards? List their full name and id. <context>: CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE player_award (player_id VARCHAR)
SELECT T1.name_first, T1.name_last, T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 3
2,143
<question>: List three countries which are the origins of the least players. <context>: CREATE TABLE player (birth_country VARCHAR)
SELECT birth_country FROM player GROUP BY birth_country ORDER BY COUNT(*) LIMIT 3
2,144
<question>: Find all the players' first name and last name who have empty death record. <context>: CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, death_year VARCHAR)
SELECT name_first, name_last FROM player WHERE death_year = ''
2,145
<question>: How many players born in USA are right-handed batters? That is, have the batter value 'R'. <context>: CREATE TABLE player (birth_country VARCHAR, bats VARCHAR)
SELECT COUNT(*) FROM player WHERE birth_country = 'USA' AND bats = 'R'
2,146
<question>: What is the average height of the players from the college named 'Yale University'? <context>: CREATE TABLE player_college (player_id VARCHAR, college_id VARCHAR); CREATE TABLE player (height INTEGER, player_id VARCHAR); CREATE TABLE college (college_id VARCHAR, name_full VARCHAR)
SELECT AVG(T1.height) FROM player AS T1 JOIN player_college AS T2 ON T1.player_id = T2.player_id JOIN college AS T3 ON T3.college_id = T2.college_id WHERE T3.name_full = 'Yale University'
2,147
<question>: What is the highest salary among each team? List the team name, id and maximum salary. <context>: CREATE TABLE salary (salary INTEGER, team_id VARCHAR); CREATE TABLE team (name VARCHAR, team_id VARCHAR)
SELECT T1.name, T1.team_id, MAX(T2.salary) FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id
2,148
<question>: What are the name and id of the team offering the lowest average salary? <context>: CREATE TABLE team (name VARCHAR, team_id VARCHAR); CREATE TABLE salary (team_id VARCHAR, salary INTEGER)
SELECT T1.name, T1.team_id FROM team AS T1 JOIN salary AS T2 ON T1.team_id = T2.team_id GROUP BY T1.team_id ORDER BY AVG(T2.salary) LIMIT 1
2,149
<question>: Find the players' first name and last name who won award both in 1960 and in 1961. <context>: CREATE TABLE player (name_first VARCHAR, name_last VARCHAR); CREATE TABLE player_award (year VARCHAR)
SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1960 INTERSECT SELECT T1.name_first, T1.name_last FROM player AS T1 JOIN player_award AS T2 WHERE T2.year = 1961
2,150
<question>: List players' first name and last name who have weight greater than 220 or height shorter than 75. <context>: CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, weight VARCHAR, height VARCHAR)
SELECT name_first, name_last FROM player WHERE weight > 220 OR height < 75
2,151
<question>: List the maximum scores of the team Boston Red Stockings when the team won in postseason? <context>: CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE postseason (wins INTEGER, team_id_winner VARCHAR)
SELECT MAX(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'
2,152
<question>: How many times did Boston Red Stockings lose in 2009 postseason? <context>: CREATE TABLE postseason (team_id_loser VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)
SELECT COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2009
2,153
<question>: What are the name and id of the team with the most victories in 2008 postseason? <context>: CREATE TABLE postseason (team_id_winner VARCHAR, year VARCHAR); CREATE TABLE team (name VARCHAR, team_id_br VARCHAR)
SELECT T2.name, T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY COUNT(*) DESC LIMIT 1
2,154
<question>: What is the number of wins the team Boston Red Stockings got in the postseasons each year in history? <context>: CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE postseason (year VARCHAR, team_id_winner VARCHAR)
SELECT COUNT(*), T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year
2,155
<question>: What is the total number of postseason games that team Boston Red Stockings participated in? <context>: CREATE TABLE postseason (team_id_winner VARCHAR, team_id_loser VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)
SELECT COUNT(*) FROM (SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings')
2,156
<question>: How many games in 1885 postseason resulted in ties (that is, the value of "ties" is '1')? <context>: CREATE TABLE postseason (YEAR VARCHAR, ties VARCHAR)
SELECT COUNT(*) FROM postseason WHERE YEAR = 1885 AND ties = 1
2,157
<question>: What is the total salary paid by team Boston Red Stockings in 2010? <context>: CREATE TABLE salary (salary INTEGER, team_id VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)
SELECT SUM(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2010
2,158
<question>: How many players were in the team Boston Red Stockings in 2000? <context>: CREATE TABLE salary (team_id VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)
SELECT COUNT(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year = 2000
2,159
<question>: List the 3 highest salaries of the players in 2001? <context>: CREATE TABLE salary (salary VARCHAR, YEAR VARCHAR)
SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3
2,160
<question>: What were all the salary values of players in 2010 and 2001? <context>: CREATE TABLE salary (salary VARCHAR, YEAR VARCHAR)
SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001
2,161
<question>: In which year did the least people enter hall of fame? <context>: CREATE TABLE hall_of_fame (yearid VARCHAR)
SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY COUNT(*) LIMIT 1
2,162
<question>: How many parks are there in Atlanta city? <context>: CREATE TABLE park (city VARCHAR)
SELECT COUNT(*) FROM park WHERE city = 'Atlanta'
2,163
<question>: How many games were played in park "Columbia Park" in 1907? <context>: CREATE TABLE park (park_id VARCHAR, park_name VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR)
SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park'
2,164
<question>: How many games were played in city Atlanta in 2000? <context>: CREATE TABLE park (park_id VARCHAR, city VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR)
SELECT COUNT(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2000 AND T2.city = 'Atlanta'
2,165
<question>: What is the total home game attendance of team Boston Red Stockings from 2000 to 2010? <context>: CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE home_game (attendance INTEGER, team_id VARCHAR, year VARCHAR)
SELECT SUM(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010
2,166
<question>: How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total? <context>: CREATE TABLE salary (salary INTEGER, player_id VARCHAR, year VARCHAR); CREATE TABLE player (player_id VARCHAR, name_first VARCHAR, name_last VARCHAR)
SELECT SUM(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first = 'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990
2,167
<question>: List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007. <context>: CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE salary (player_id VARCHAR, team_id VARCHAR, year VARCHAR)
SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'
2,168
<question>: How many home games did the team Boston Red Stockings play from 1990 to 2000 in total? <context>: CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE home_game (games INTEGER, team_id VARCHAR, year VARCHAR)
SELECT SUM(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000
2,169
<question>: Which team had the least number of attendances in home games in 1980? <context>: CREATE TABLE home_game (team_id VARCHAR, year VARCHAR, attendance VARCHAR); CREATE TABLE team (name VARCHAR, team_id_br VARCHAR)
SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance LIMIT 1
2,170
<question>: List the names of states that have more than 2 parks. <context>: CREATE TABLE park (state VARCHAR)
SELECT state FROM park GROUP BY state HAVING COUNT(*) > 2
2,171
<question>: How many team franchises are active, with active value 'Y'? <context>: CREATE TABLE team_franchise (active VARCHAR)
SELECT COUNT(*) FROM team_franchise WHERE active = 'Y'
2,172
<question>: Which cities have 2 to 4 parks? <context>: CREATE TABLE park (city VARCHAR)
SELECT city FROM park GROUP BY city HAVING COUNT(*) BETWEEN 2 AND 4
2,173
<question>: Which park had most attendances in 2008? <context>: CREATE TABLE park (park_name VARCHAR, park_id VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR, attendance VARCHAR)
SELECT T2.park_name FROM home_game AS T1 JOIN park AS T2 ON T1.park_id = T2.park_id WHERE T1.year = 2008 ORDER BY T1.attendance DESC LIMIT 1
2,174
<question>: How many camera lenses have a focal length longer than 15 mm? <context>: CREATE TABLE camera_lens (focal_length_mm INTEGER)
SELECT COUNT(*) FROM camera_lens WHERE focal_length_mm > 15
2,175
<question>: Find the brand and name for each camera lens, and sort in descending order of maximum aperture. <context>: CREATE TABLE camera_lens (brand VARCHAR, name VARCHAR, max_aperture VARCHAR)
SELECT brand, name FROM camera_lens ORDER BY max_aperture DESC
2,176
<question>: List the id, color scheme, and name for all the photos. <context>: CREATE TABLE photos (id VARCHAR, color VARCHAR, name VARCHAR)
SELECT id, color, name FROM photos
2,177
<question>: What are the maximum and average height of the mountains? <context>: CREATE TABLE mountain (height INTEGER)
SELECT MAX(height), AVG(height) FROM mountain
2,178
<question>: What are the average prominence of the mountains in country 'Morocco'? <context>: CREATE TABLE mountain (prominence INTEGER, country VARCHAR)
SELECT AVG(prominence) FROM mountain WHERE country = 'Morocco'
2,179
<question>: What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'? <context>: CREATE TABLE mountain (name VARCHAR, height VARCHAR, prominence VARCHAR, range VARCHAR)
SELECT name, height, prominence FROM mountain WHERE range <> 'Aberdare Range'
2,180
<question>: What are the id and name of the photos for mountains? <context>: CREATE TABLE photos (mountain_id VARCHAR); CREATE TABLE mountain (id VARCHAR, name VARCHAR, height INTEGER)
SELECT T1.id, T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.height > 4000
2,181
<question>: What are the id and name of the mountains that have at least 2 photos? <context>: CREATE TABLE mountain (id VARCHAR, name VARCHAR); CREATE TABLE photos (mountain_id VARCHAR)
SELECT T1.id, T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id GROUP BY T1.id HAVING COUNT(*) >= 2
2,182
<question>: What are the names of the cameras that have taken picture of the most mountains? <context>: CREATE TABLE camera_lens (name VARCHAR, id VARCHAR); CREATE TABLE photos (camera_lens_id VARCHAR)
SELECT T2.name FROM photos AS T1 JOIN camera_lens AS T2 ON T1.camera_lens_id = T2.id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1
2,183
<question>: What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'? <context>: CREATE TABLE photos (camera_lens_id VARCHAR); CREATE TABLE camera_lens (name VARCHAR, id VARCHAR, brand VARCHAR)
SELECT T1.name FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus'
2,184
<question>: How many different kinds of lens brands are there? <context>: CREATE TABLE camera_lens (brand VARCHAR)
SELECT COUNT(DISTINCT brand) FROM camera_lens
2,185
<question>: How many camera lenses are not used in taking any photos? <context>: CREATE TABLE photos (id VARCHAR, camera_lens_id VARCHAR); CREATE TABLE camera_lens (id VARCHAR, camera_lens_id VARCHAR)
SELECT COUNT(*) FROM camera_lens WHERE NOT id IN (SELECT camera_lens_id FROM photos)
2,186
<question>: How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'? <context>: CREATE TABLE mountain (id VARCHAR, country VARCHAR); CREATE TABLE photos (camera_lens_id VARCHAR, mountain_id VARCHAR)
SELECT COUNT(DISTINCT T2.camera_lens_id) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.country = 'Ethiopia'
2,187
<question>: List the brands of lenses that took both a picture of mountains with range 'Toubkal Atlas' and a picture of mountains with range 'Lasta Massif' <context>: CREATE TABLE mountain (id VARCHAR, range VARCHAR); CREATE TABLE photos (mountain_id VARCHAR, camera_lens_id VARCHAR); CREATE TABLE camera_lens (brand VARCHAR, id VARCHAR)
SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Lasta Massif'
2,188
<question>: Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'. <context>: CREATE TABLE camera_lens (id VARCHAR, brand VARCHAR); CREATE TABLE mountain (name VARCHAR, prominence VARCHAR, id VARCHAR); CREATE TABLE photos (mountain_id VARCHAR, camera_lens_id VARCHAR); CREATE TABLE mountain (name VARCHAR, prominence VARCHAR)
SELECT name, prominence FROM mountain EXCEPT SELECT T1.name, T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T3.brand = 'Sigma'
2,189
<question>: List the camera lens names containing substring "Digital". <context>: CREATE TABLE camera_lens (name VARCHAR)
SELECT name FROM camera_lens WHERE name LIKE "%Digital%"
2,190
<question>: What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos. <context>: CREATE TABLE photos (camera_lens_id VARCHAR); CREATE TABLE camera_lens (name VARCHAR, id VARCHAR)
SELECT T1.name, COUNT(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY COUNT(*)
2,191
<question>: Find the names of channels that are not owned by CCTV. <context>: CREATE TABLE channel (name VARCHAR, OWNER VARCHAR)
SELECT name FROM channel WHERE OWNER <> 'CCTV'
2,192
<question>: List all channel names ordered by their rating in percent from big to small. <context>: CREATE TABLE channel (name VARCHAR, rating_in_percent VARCHAR)
SELECT name FROM channel ORDER BY rating_in_percent DESC
2,193
<question>: What is the owner of the channel that has the highest rating ratio? <context>: CREATE TABLE channel (OWNER VARCHAR, rating_in_percent VARCHAR)
SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1
2,194
<question>: how many programs are there? <context>: CREATE TABLE program (Id VARCHAR)
SELECT COUNT(*) FROM program
2,195
<question>: list all the names of programs, ordering by launch time. <context>: CREATE TABLE program (name VARCHAR, launch VARCHAR)
SELECT name FROM program ORDER BY launch
2,196
<question>: List the name, origin and owner of each program. <context>: CREATE TABLE program (name VARCHAR, origin VARCHAR, OWNER VARCHAR)
SELECT name, origin, OWNER FROM program
2,197
<question>: find the name of the program that was launched most recently. <context>: CREATE TABLE program (name VARCHAR, launch VARCHAR)
SELECT name FROM program ORDER BY launch DESC LIMIT 1
2,198
<question>: find the total percentage share of all channels owned by CCTV. <context>: CREATE TABLE channel (Share_in_percent INTEGER, OWNER VARCHAR)
SELECT SUM(Share_in_percent) FROM channel WHERE OWNER = 'CCTV'
2,199
<question>: Find the names of the channels that are broadcast in the morning. <context>: CREATE TABLE channel (name VARCHAR, channel_id VARCHAR); CREATE TABLE broadcast (channel_id VARCHAR, time_of_day VARCHAR)
SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning'