training_input
stringlengths 118
1.06k
|
---|
###context:CREATE TABLE song (languages VARCHAR, rating INTEGER)
###human: What is the average rating of songs for each language?
###assistant: SELECT AVG(rating), languages FROM song GROUP BY languages |
###context:CREATE TABLE artist (gender VARCHAR, artist_name VARCHAR); CREATE TABLE song (artist_name VARCHAR, resolution VARCHAR)
###human: Return the gender and name of artist who produced the song with the lowest resolution.
###assistant: 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 |
###context:CREATE TABLE files (formats VARCHAR)
###human: For each file format, return the number of artists who released songs in that format.
###assistant: SELECT COUNT(*), formats FROM files GROUP BY formats |
###context:CREATE TABLE song (song_name VARCHAR, resolution INTEGER, languages VARCHAR)
###human: Find the distinct names of all songs that have a higher resolution than some songs in English.
###assistant: SELECT DISTINCT song_name FROM song WHERE resolution > (SELECT MIN(resolution) FROM song WHERE languages = "english") |
###context:CREATE TABLE song (song_name VARCHAR, rating INTEGER, genre_is VARCHAR)
###human: What are the names of all songs that have a lower rating than some song of blues genre?
###assistant: SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = "blues") |
###context:CREATE TABLE song (artist_name VARCHAR, song_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)
###human: What is the name and country of origin of the artist who released a song that has "love" in its title?
###assistant: 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%" |
###context:CREATE TABLE song (artist_name VARCHAR, releasedate VARCHAR); CREATE TABLE artist (artist_name VARCHAR, gender VARCHAR)
###human: List the name and gender for all artists who released songs in March.
###assistant: 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%" |
###context:CREATE TABLE genre (g_name VARCHAR, rating VARCHAR)
###human: List the names of all genres in alphabetical oder, together with its ratings.
###assistant: SELECT g_name, rating FROM genre ORDER BY g_name |
###context:CREATE TABLE song (song_name VARCHAR, resolution VARCHAR)
###human: Give me a list of the names of all songs ordered by their resolution.
###assistant: SELECT song_name FROM song ORDER BY resolution |
###context:CREATE TABLE song (f_id VARCHAR, formats VARCHAR, resolution INTEGER); CREATE TABLE files (f_id VARCHAR, formats VARCHAR, resolution INTEGER)
###human: What are the ids of songs that are available in either mp4 format or have resolution above 720?
###assistant: SELECT f_id FROM files WHERE formats = "mp4" UNION SELECT f_id FROM song WHERE resolution > 720 |
###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)
###human: List the names of all songs that have 4 minute duration or are in English.
###assistant: 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" |
###context:CREATE TABLE song (languages VARCHAR)
###human: What is the language used most often in the songs?
###assistant: SELECT languages FROM song GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1 |
###context:CREATE TABLE song (artist_name VARCHAR, languages VARCHAR, resolution INTEGER)
###human: What is the language that was used most often in songs with resolution above 500?
###assistant: SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY COUNT(*) DESC LIMIT 1 |
###context:CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, gender VARCHAR)
###human: What are the names of artists who are Male and are from UK?
###assistant: SELECT artist_name FROM artist WHERE country = "UK" AND gender = "Male" |
###context:CREATE TABLE song (song_name VARCHAR, genre_is VARCHAR, languages VARCHAR)
###human: Find the names of songs whose genre is modern or language is English.
###assistant: SELECT song_name FROM song WHERE genre_is = "modern" OR languages = "english" |
###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)
###human: Return the names of songs for which format is mp3 and resolution is below 1000.
###assistant: 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 |
###context:CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)
###human: Return the names of singers who are from UK and released an English song.
###assistant: 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" |
###context:CREATE TABLE song (rating INTEGER, resolution INTEGER, languages VARCHAR)
###human: What are the average rating and resolution of songs that are in Bangla?
###assistant: SELECT AVG(rating), AVG(resolution) FROM song WHERE languages = "bangla" |
###context:CREATE TABLE files (f_id VARCHAR, duration VARCHAR); CREATE TABLE song (resolution INTEGER, f_id VARCHAR)
###human: What are the maximum and minimum resolution of songs whose duration is 3 minutes?
###assistant: 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:%" |
###context:CREATE TABLE song (languages VARCHAR, resolution INTEGER, f_id VARCHAR); CREATE TABLE files (duration INTEGER, f_id VARCHAR)
###human: What are the maximum duration and resolution of songs grouped and ordered by languages?
###assistant: 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 |
###context:CREATE TABLE song (genre_is VARCHAR, rating INTEGER, f_id VARCHAR); CREATE TABLE files (duration INTEGER, f_id VARCHAR)
###human: What are the shortest duration and lowest rating of songs grouped by genre and ordered by genre?
###assistant: 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 |
###context:CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR)
###human: Find the names and number of works of all artists who have at least one English songs.
###assistant: 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 |
###context:CREATE TABLE song (artist_name VARCHAR, resolution INTEGER); CREATE TABLE artist (artist_name VARCHAR, country VARCHAR)
###human: Find the name and country of origin for all artists who have release at least one song of resolution above 900.
###assistant: 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 |
###context:CREATE TABLE song (artist_name VARCHAR); CREATE TABLE artist (artist_name VARCHAR)
###human: Find the names and number of works of the three artists who have produced the most songs.
###assistant: 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 |
###context:CREATE TABLE song (artist_name VARCHAR); CREATE TABLE artist (country VARCHAR, artist_name VARCHAR)
###human: Find the country of origin for the artist who made the least number of songs?
###assistant: 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 |
###context:CREATE TABLE song (song_name VARCHAR, rating INTEGER, languages VARCHAR)
###human: What are the names of the songs whose rating is below the rating of all songs in English?
###assistant: SELECT song_name FROM song WHERE rating < (SELECT MIN(rating) FROM song WHERE languages = 'english') |
###context:CREATE TABLE song (f_id VARCHAR, resolution INTEGER, rating INTEGER)
###human: What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8?
###assistant: SELECT f_id FROM song WHERE resolution > (SELECT MAX(resolution) FROM song WHERE rating < 8) |
###context:CREATE TABLE song (f_id VARCHAR, resolution INTEGER, genre_is VARCHAR)
###human: What is ids of the songs whose resolution is higher than the average resolution of songs in modern genre?
###assistant: SELECT f_id FROM song WHERE resolution > (SELECT AVG(resolution) FROM song WHERE genre_is = "modern") |
###context:CREATE TABLE song (artist_name VARCHAR, languages VARCHAR); CREATE TABLE artist (artist_name VARCHAR)
###human: Find the top 3 artists who have the largest number of songs works whose language is Bangla.
###assistant: 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 |
###context:CREATE TABLE song (f_id VARCHAR, genre_is VARCHAR, artist_name VARCHAR, languages VARCHAR, rating VARCHAR)
###human: List the id, genre and artist name of English songs ordered by rating.
###assistant: SELECT f_id, genre_is, artist_name FROM song WHERE languages = "english" ORDER BY rating |
###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)
###human: List the duration, file size and format of songs whose genre is pop, ordered by title?
###assistant: 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 |
###context:CREATE TABLE song (artist_name VARCHAR, languages VARCHAR, rating INTEGER)
###human: Find the names of the artists who have produced English songs but have never received rating higher than 8.
###assistant: SELECT DISTINCT artist_name FROM song WHERE languages = "english" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8 |
###context:CREATE TABLE artist (artist_name VARCHAR, country VARCHAR, rating INTEGER); CREATE TABLE song (artist_name VARCHAR, country VARCHAR, rating INTEGER)
###human: Find the names of the artists who are from Bangladesh and have never received rating higher than 7.
###assistant: SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7 |
###context:CREATE TABLE player_college (college_id VARCHAR); CREATE TABLE college (name_full VARCHAR, college_id VARCHAR)
###human: what is the full name and id of the college with the largest number of baseball players?
###assistant: 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 |
###context:CREATE TABLE salary (salary INTEGER, team_id VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)
###human: What is average salary of the players in the team named 'Boston Red Stockings' ?
###assistant: 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' |
###context:CREATE TABLE all_star (player_id VARCHAR); CREATE TABLE player (player_id VARCHAR)
###human: What are first and last names of players participating in all star game in 1998?
###assistant: SELECT name_first, name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id = T2.player_id WHERE YEAR = 1998 |
###context:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE all_star (player_id VARCHAR)
###human: What are the first name, last name and id of the player with the most all star game experiences? Also list the count.
###assistant: 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 |
###context:CREATE TABLE hall_of_fame (yearid VARCHAR)
###human: How many players enter hall of fame each year?
###assistant: SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid |
###context:CREATE TABLE home_game (YEAR VARCHAR, attendance INTEGER)
###human: What is the average number of attendance at home games for each year?
###assistant: SELECT YEAR, AVG(attendance) FROM home_game GROUP BY YEAR |
###context:CREATE TABLE team (team_id VARCHAR, rank VARCHAR); CREATE TABLE home_game (team_id VARCHAR, year VARCHAR, attendance INTEGER)
###human: In 2014, what are the id and rank of the team that has the largest average number of attendance?
###assistant: 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 |
###context:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE manager_award (player_id VARCHAR)
###human: What are the manager's first name, last name and id who won the most manager award?
###assistant: 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 |
###context:CREATE TABLE park (state VARCHAR)
###human: How many parks are there in the state of NY?
###assistant: SELECT COUNT(*) FROM park WHERE state = 'NY' |
###context:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, player_id VARCHAR); CREATE TABLE player_award (player_id VARCHAR)
###human: Which 3 players won the most player awards? List their full name and id.
###assistant: 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 |
###context:CREATE TABLE player (birth_country VARCHAR)
###human: List three countries which are the origins of the least players.
###assistant: SELECT birth_country FROM player GROUP BY birth_country ORDER BY COUNT(*) LIMIT 3 |
###context:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, death_year VARCHAR)
###human: Find all the players' first name and last name who have empty death record.
###assistant: SELECT name_first, name_last FROM player WHERE death_year = '' |
###context:CREATE TABLE player (birth_country VARCHAR, bats VARCHAR)
###human: How many players born in USA are right-handed batters? That is, have the batter value 'R'.
###assistant: SELECT COUNT(*) FROM player WHERE birth_country = 'USA' AND bats = 'R' |
###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)
###human: What is the average height of the players from the college named 'Yale University'?
###assistant: 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' |
###context:CREATE TABLE salary (salary INTEGER, team_id VARCHAR); CREATE TABLE team (name VARCHAR, team_id VARCHAR)
###human: What is the highest salary among each team? List the team name, id and maximum salary.
###assistant: 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 |
###context:CREATE TABLE team (name VARCHAR, team_id VARCHAR); CREATE TABLE salary (team_id VARCHAR, salary INTEGER)
###human: What are the name and id of the team offering the lowest average salary?
###assistant: 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 |
###context:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR); CREATE TABLE player_award (year VARCHAR)
###human: Find the players' first name and last name who won award both in 1960 and in 1961.
###assistant: 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 |
###context:CREATE TABLE player (name_first VARCHAR, name_last VARCHAR, weight VARCHAR, height VARCHAR)
###human: List players' first name and last name who have weight greater than 220 or height shorter than 75.
###assistant: SELECT name_first, name_last FROM player WHERE weight > 220 OR height < 75 |
###context:CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE postseason (wins INTEGER, team_id_winner VARCHAR)
###human: List the maximum scores of the team Boston Red Stockings when the team won in postseason?
###assistant: 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' |
###context:CREATE TABLE postseason (team_id_loser VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)
###human: How many times did Boston Red Stockings lose in 2009 postseason?
###assistant: 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 |
###context:CREATE TABLE postseason (team_id_winner VARCHAR, year VARCHAR); CREATE TABLE team (name VARCHAR, team_id_br VARCHAR)
###human: What are the name and id of the team with the most victories in 2008 postseason?
###assistant: 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 |
###context:CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE postseason (year VARCHAR, team_id_winner VARCHAR)
###human: What is the number of wins the team Boston Red Stockings got in the postseasons each year in history?
###assistant: 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 |
###context:CREATE TABLE postseason (team_id_winner VARCHAR, team_id_loser VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)
###human: What is the total number of postseason games that team Boston Red Stockings participated in?
###assistant: 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') |
###context:CREATE TABLE postseason (YEAR VARCHAR, ties VARCHAR)
###human: How many games in 1885 postseason resulted in ties (that is, the value of "ties" is '1')?
###assistant: SELECT COUNT(*) FROM postseason WHERE YEAR = 1885 AND ties = 1 |
###context:CREATE TABLE salary (salary INTEGER, team_id VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)
###human: What is the total salary paid by team Boston Red Stockings in 2010?
###assistant: 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 |
###context:CREATE TABLE salary (team_id VARCHAR, year VARCHAR); CREATE TABLE team (team_id_br VARCHAR, name VARCHAR)
###human: How many players were in the team Boston Red Stockings in 2000?
###assistant: 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 |
###context:CREATE TABLE salary (salary VARCHAR, YEAR VARCHAR)
###human: List the 3 highest salaries of the players in 2001?
###assistant: SELECT salary FROM salary WHERE YEAR = 2001 ORDER BY salary DESC LIMIT 3 |
###context:CREATE TABLE salary (salary VARCHAR, YEAR VARCHAR)
###human: What were all the salary values of players in 2010 and 2001?
###assistant: SELECT salary FROM salary WHERE YEAR = 2010 UNION SELECT salary FROM salary WHERE YEAR = 2001 |
###context:CREATE TABLE hall_of_fame (yearid VARCHAR)
###human: In which year did the least people enter hall of fame?
###assistant: SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY COUNT(*) LIMIT 1 |
###context:CREATE TABLE park (city VARCHAR)
###human: How many parks are there in Atlanta city?
###assistant: SELECT COUNT(*) FROM park WHERE city = 'Atlanta' |
###context:CREATE TABLE park (park_id VARCHAR, park_name VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR)
###human: How many games were played in park "Columbia Park" in 1907?
###assistant: 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' |
###context:CREATE TABLE park (park_id VARCHAR, city VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR)
###human: How many games were played in city Atlanta in 2000?
###assistant: 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' |
###context:CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE home_game (attendance INTEGER, team_id VARCHAR, year VARCHAR)
###human: What is the total home game attendance of team Boston Red Stockings from 2000 to 2010?
###assistant: 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 |
###context:CREATE TABLE salary (salary INTEGER, player_id VARCHAR, year VARCHAR); CREATE TABLE player (player_id VARCHAR, name_first VARCHAR, name_last VARCHAR)
###human: How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total?
###assistant: 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 |
###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)
###human: List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.
###assistant: 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' |
###context:CREATE TABLE team (team_id_br VARCHAR, name VARCHAR); CREATE TABLE home_game (games INTEGER, team_id VARCHAR, year VARCHAR)
###human: How many home games did the team Boston Red Stockings play from 1990 to 2000 in total?
###assistant: 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 |
###context:CREATE TABLE home_game (team_id VARCHAR, year VARCHAR, attendance VARCHAR); CREATE TABLE team (name VARCHAR, team_id_br VARCHAR)
###human: Which team had the least number of attendances in home games in 1980?
###assistant: 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 |
###context:CREATE TABLE park (state VARCHAR)
###human: List the names of states that have more than 2 parks.
###assistant: SELECT state FROM park GROUP BY state HAVING COUNT(*) > 2 |
###context:CREATE TABLE team_franchise (active VARCHAR)
###human: How many team franchises are active, with active value 'Y'?
###assistant: SELECT COUNT(*) FROM team_franchise WHERE active = 'Y' |
###context:CREATE TABLE park (city VARCHAR)
###human: Which cities have 2 to 4 parks?
###assistant: SELECT city FROM park GROUP BY city HAVING COUNT(*) BETWEEN 2 AND 4 |
###context:CREATE TABLE park (park_name VARCHAR, park_id VARCHAR); CREATE TABLE home_game (park_id VARCHAR, year VARCHAR, attendance VARCHAR)
###human: Which park had most attendances in 2008?
###assistant: 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 |
###context:CREATE TABLE camera_lens (focal_length_mm INTEGER)
###human: How many camera lenses have a focal length longer than 15 mm?
###assistant: SELECT COUNT(*) FROM camera_lens WHERE focal_length_mm > 15 |
###context:CREATE TABLE camera_lens (brand VARCHAR, name VARCHAR, max_aperture VARCHAR)
###human: Find the brand and name for each camera lens, and sort in descending order of maximum aperture.
###assistant: SELECT brand, name FROM camera_lens ORDER BY max_aperture DESC |
###context:CREATE TABLE photos (id VARCHAR, color VARCHAR, name VARCHAR)
###human: List the id, color scheme, and name for all the photos.
###assistant: SELECT id, color, name FROM photos |
###context:CREATE TABLE mountain (height INTEGER)
###human: What are the maximum and average height of the mountains?
###assistant: SELECT MAX(height), AVG(height) FROM mountain |
###context:CREATE TABLE mountain (prominence INTEGER, country VARCHAR)
###human: What are the average prominence of the mountains in country 'Morocco'?
###assistant: SELECT AVG(prominence) FROM mountain WHERE country = 'Morocco' |
###context:CREATE TABLE mountain (name VARCHAR, height VARCHAR, prominence VARCHAR, range VARCHAR)
###human: What are the name, height and prominence of mountains which do not belong to the range 'Aberdare Range'?
###assistant: SELECT name, height, prominence FROM mountain WHERE range <> 'Aberdare Range' |
###context:CREATE TABLE photos (mountain_id VARCHAR); CREATE TABLE mountain (id VARCHAR, name VARCHAR, height INTEGER)
###human: What are the id and name of the photos for mountains?
###assistant: SELECT T1.id, T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.height > 4000 |
###context:CREATE TABLE mountain (id VARCHAR, name VARCHAR); CREATE TABLE photos (mountain_id VARCHAR)
###human: What are the id and name of the mountains that have at least 2 photos?
###assistant: 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 |
###context:CREATE TABLE camera_lens (name VARCHAR, id VARCHAR); CREATE TABLE photos (camera_lens_id VARCHAR)
###human: What are the names of the cameras that have taken picture of the most mountains?
###assistant: 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 |
###context:CREATE TABLE photos (camera_lens_id VARCHAR); CREATE TABLE camera_lens (name VARCHAR, id VARCHAR, brand VARCHAR)
###human: What are the names of photos taken with the lens brand 'Sigma' or 'Olympus'?
###assistant: 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' |
###context:CREATE TABLE camera_lens (brand VARCHAR)
###human: How many different kinds of lens brands are there?
###assistant: SELECT COUNT(DISTINCT brand) FROM camera_lens |
###context:CREATE TABLE photos (id VARCHAR, camera_lens_id VARCHAR); CREATE TABLE camera_lens (id VARCHAR, camera_lens_id VARCHAR)
###human: How many camera lenses are not used in taking any photos?
###assistant: SELECT COUNT(*) FROM camera_lens WHERE NOT id IN (SELECT camera_lens_id FROM photos) |
###context:CREATE TABLE mountain (id VARCHAR, country VARCHAR); CREATE TABLE photos (camera_lens_id VARCHAR, mountain_id VARCHAR)
###human: How many distinct kinds of camera lenses are used to take photos of mountains in the country 'Ethiopia'?
###assistant: 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' |
###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)
###human: 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'
###assistant: 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' |
###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)
###human: Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.
###assistant: 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' |
###context:CREATE TABLE camera_lens (name VARCHAR)
###human: List the camera lens names containing substring "Digital".
###assistant: SELECT name FROM camera_lens WHERE name LIKE "%Digital%" |
###context:CREATE TABLE photos (camera_lens_id VARCHAR); CREATE TABLE camera_lens (name VARCHAR, id VARCHAR)
###human: What is the name of each camera lens and the number of photos taken by it? Order the result by the count of photos.
###assistant: 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(*) |
###context:CREATE TABLE channel (name VARCHAR, OWNER VARCHAR)
###human: Find the names of channels that are not owned by CCTV.
###assistant: SELECT name FROM channel WHERE OWNER <> 'CCTV' |
###context:CREATE TABLE channel (name VARCHAR, rating_in_percent VARCHAR)
###human: List all channel names ordered by their rating in percent from big to small.
###assistant: SELECT name FROM channel ORDER BY rating_in_percent DESC |
###context:CREATE TABLE channel (OWNER VARCHAR, rating_in_percent VARCHAR)
###human: What is the owner of the channel that has the highest rating ratio?
###assistant: SELECT OWNER FROM channel ORDER BY rating_in_percent DESC LIMIT 1 |
###context:CREATE TABLE program (Id VARCHAR)
###human: how many programs are there?
###assistant: SELECT COUNT(*) FROM program |
###context:CREATE TABLE program (name VARCHAR, launch VARCHAR)
###human: list all the names of programs, ordering by launch time.
###assistant: SELECT name FROM program ORDER BY launch |
###context:CREATE TABLE program (name VARCHAR, origin VARCHAR, OWNER VARCHAR)
###human: List the name, origin and owner of each program.
###assistant: SELECT name, origin, OWNER FROM program |
###context:CREATE TABLE program (name VARCHAR, launch VARCHAR)
###human: find the name of the program that was launched most recently.
###assistant: SELECT name FROM program ORDER BY launch DESC LIMIT 1 |
###context:CREATE TABLE channel (Share_in_percent INTEGER, OWNER VARCHAR)
###human: find the total percentage share of all channels owned by CCTV.
###assistant: SELECT SUM(Share_in_percent) FROM channel WHERE OWNER = 'CCTV' |
###context:CREATE TABLE channel (name VARCHAR, channel_id VARCHAR); CREATE TABLE broadcast (channel_id VARCHAR, time_of_day VARCHAR)
###human: Find the names of the channels that are broadcast in the morning.
###assistant: SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' |
Subsets and Splits