db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
game_1 | select count(distinct sportname) from sportsinfo | Question: how many different types of sports do we offer? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID =... | how many different types of sports do we offer? |
game_1 | select count(distinct stuid) from sportsinfo | Question: how many students play sports? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID = Student.StuID, P... | how many students play sports? |
game_1 | select count(distinct stuid) from sportsinfo | Question: how many different students are involved in sports? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.Stu... | how many different students are involved in sports? |
game_1 | select stuid from sportsinfo where onscholarship = 'y' | Question: list ids for all student who are on scholarship. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID ... | list ids for all student who are on scholarship. |
game_1 | select stuid from sportsinfo where onscholarship = 'y' | Question: what are the ids for all sporty students who are on scholarship? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Pl... | what are the ids for all sporty students who are on scholarship? |
game_1 | select t2.lname from sportsinfo as t1 join student as t2 on t1.stuid = t2.stuid where t1.onscholarship = 'y' | Question: show last names for all student who are on scholarship. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games... | show last names for all student who are on scholarship. |
game_1 | select t2.lname from sportsinfo as t1 join student as t2 on t1.stuid = t2.stuid where t1.onscholarship = 'y' | Question: what are the last names for all scholarship students? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.S... | what are the last names for all scholarship students? |
game_1 | select sum(gamesplayed) from sportsinfo | Question: how many games are played for all students? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID = Stu... | how many games are played for all students? |
game_1 | select sum(gamesplayed) from sportsinfo | Question: what is the total number of games played? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID = Stude... | what is the total number of games played? |
game_1 | select sum(gamesplayed) from sportsinfo where sportname = 'football' and onscholarship = 'y' | Question: how many games are played for all football games by students on scholarship? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship.... | how many games are played for all football games by students on scholarship? |
game_1 | select sum(gamesplayed) from sportsinfo where sportname = 'football' and onscholarship = 'y' | Question: what is the total number of all football games played by scholarship students? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarshi... | what is the total number of all football games played by scholarship students? |
game_1 | select sportname , count(*) from sportsinfo group by sportname | Question: show all sport name and the number of students. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID =... | show all sport name and the number of students. |
game_1 | select sportname , count(*) from sportsinfo group by sportname | Question: how many students play each sport? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID = Student.StuI... | how many students play each sport? |
game_1 | select stuid , count(*) , sum(gamesplayed) from sportsinfo group by stuid | Question: show all student ids with the number of sports and total number of games played | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarsh... | show all student ids with the number of sports and total number of games played |
game_1 | select stuid , count(*) , sum(gamesplayed) from sportsinfo group by stuid | Question: what are the ids of all students along with how many sports and games did they play? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScho... | what are the ids of all students along with how many sports and games did they play? |
game_1 | select stuid from sportsinfo group by stuid having sum(hoursperweek) > 10 | Question: show all student ids with more than total 10 hours per week on all sports played. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholar... | show all student ids with more than total 10 hours per week on all sports played. |
game_1 | select stuid from sportsinfo group by stuid having sum(hoursperweek) > 10 | Question: what are the student ids for everybody who worked for more than 10 hours per week on all sports? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPl... | what are the student ids for everybody who worked for more than 10 hours per week on all sports? |
game_1 | select t2.fname , t2.lname from sportsinfo as t1 join student as t2 on t1.stuid = t2.stuid group by t1.stuid order by count(*) desc limit 1 | Question: what is the first name and last name of the student who have most number of sports? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnSchol... | what is the first name and last name of the student who have most number of sports? |
game_1 | select t2.fname , t2.lname from sportsinfo as t1 join student as t2 on t1.stuid = t2.stuid group by t1.stuid order by count(*) desc limit 1 | Question: what is the first and last name of the student who played the most sports? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. |... | what is the first and last name of the student who played the most sports? |
game_1 | select sportname from sportsinfo where onscholarship = 'y' group by sportname order by count(*) desc limit 1 | Question: which sport has most number of students on scholarship? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games... | which sport has most number of students on scholarship? |
game_1 | select sportname from sportsinfo where onscholarship = 'y' group by sportname order by count(*) desc limit 1 | Question: what is the sport with the most scholarship students? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.S... | what is the sport with the most scholarship students? |
game_1 | select stuid from student except select stuid from sportsinfo | Question: show student ids who don't have any sports. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID = Stu... | show student ids who don't have any sports. |
game_1 | select stuid from student except select stuid from sportsinfo | Question: what are the ids of all students who don't play sports? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games... | what are the ids of all students who don't play sports? |
game_1 | select stuid from student where major = 600 intersect select stuid from sportsinfo where onscholarship = 'y' | Question: show student ids who are on scholarship and have major 600. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_G... | show student ids who are on scholarship and have major 600. |
game_1 | select stuid from student where major = 600 intersect select stuid from sportsinfo where onscholarship = 'y' | Question: what are the student ids for those on scholarship in major number 600? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joi... | what are the student ids for those on scholarship in major number 600? |
game_1 | select stuid from student where sex = 'f' intersect select stuid from sportsinfo where sportname = 'football' | Question: show student ids who are female and play football. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuI... | show student ids who are female and play football. |
game_1 | select stuid from student where sex = 'f' intersect select stuid from sportsinfo where sportname = 'football' | Question: what are the ids of all female students who play football? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Ga... | what are the ids of all female students who play football? |
game_1 | select stuid from student where sex = 'm' except select stuid from sportsinfo where sportname = 'football' | Question: show all male student ids who don't play football. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuI... | show all male student ids who don't play football. |
game_1 | select stuid from student where sex = 'm' except select stuid from sportsinfo where sportname = 'football' | Question: what are the ids of all male students who do not play football? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Pla... | what are the ids of all male students who do not play football? |
game_1 | select sum(hoursperweek) , sum(gamesplayed) from sportsinfo as t1 join student as t2 on t1.stuid = t2.stuid where t2.fname = 'david' and t2.lname = 'shieber' | Question: show total hours per week and number of games played for student david shieber. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarsh... | show total hours per week and number of games played for student david shieber. |
game_1 | select sum(hoursperweek) , sum(gamesplayed) from sportsinfo as t1 join student as t2 on t1.stuid = t2.stuid where t2.fname = 'david' and t2.lname = 'shieber' | Question: what is the total number of hours per work and number of games played by david shieber? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnS... | what is the total number of hours per work and number of games played by david shieber? |
game_1 | select sum(hoursperweek) , sum(gamesplayed) from sportsinfo as t1 join student as t2 on t1.stuid = t2.stuid where t2.age < 20 | Question: show total hours per week and number of games played for students under 20. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. ... | show total hours per week and number of games played for students under 20. |
game_1 | select sum(hoursperweek) , sum(gamesplayed) from sportsinfo as t1 join student as t2 on t1.stuid = t2.stuid where t2.age < 20 | Question: what is the total number of hours per week and number of games played by students under 20? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed,... | what is the total number of hours per week and number of games played by students under 20? |
game_1 | select count(distinct stuid) from plays_games | Question: how many students play video games? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID = Student.Stu... | how many students play video games? |
game_1 | select count(distinct stuid) from plays_games | Question: how many different students play games? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID = Student... | how many different students play games? |
game_1 | select stuid from student except select stuid from plays_games | Question: show ids of students who don't play video game. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID =... | show ids of students who don't play video game. |
game_1 | select stuid from student except select stuid from plays_games | Question: what are the ids of all students who are not video game players? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Pl... | what are the ids of all students who are not video game players? |
game_1 | select stuid from sportsinfo intersect select stuid from plays_games | Question: show ids of students who play video game and play sports. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Gam... | show ids of students who play video game and play sports. |
game_1 | select stuid from sportsinfo intersect select stuid from plays_games | Question: what are the ids of all students who played video games and sports? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins:... | what are the ids of all students who played video games and sports? |
game_1 | select gameid , sum(hours_played) from plays_games group by gameid | Question: show all game ids and the number of hours played. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID... | show all game ids and the number of hours played. |
game_1 | select gameid , sum(hours_played) from plays_games group by gameid | Question: what are ids and total number of hours played for each game? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_... | what are ids and total number of hours played for each game? |
game_1 | select stuid , sum(hours_played) from plays_games group by stuid | Question: show all student ids and the number of hours played. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.St... | show all student ids and the number of hours played. |
game_1 | select stuid , sum(hours_played) from plays_games group by stuid | Question: what are the ids of all students and number of hours played? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_... | what are the ids of all students and number of hours played? |
game_1 | select gname from plays_games as t1 join video_games as t2 on t1.gameid = t2.gameid group by t1.gameid order by sum(hours_played) desc limit 1 | Question: show the game name that has most number of hours played. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Game... | show the game name that has most number of hours played. |
game_1 | select gname from plays_games as t1 join video_games as t2 on t1.gameid = t2.gameid group by t1.gameid order by sum(hours_played) desc limit 1 | Question: what is the name of the game that has been played the most? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_G... | what is the name of the game that has been played the most? |
game_1 | select gname from plays_games as t1 join video_games as t2 on t1.gameid = t2.gameid group by t1.gameid having sum(hours_played) >= 1000 | Question: show all game names played by at least 1000 hours. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuI... | show all game names played by at least 1000 hours. |
game_1 | select gname from plays_games as t1 join video_games as t2 on t1.gameid = t2.gameid group by t1.gameid having sum(hours_played) >= 1000 | Question: what are the names of all the games that have been played for at least 1000 hours? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnSchola... | what are the names of all the games that have been played for at least 1000 hours? |
game_1 | select gname from plays_games as t1 join video_games as t2 on t1.gameid = t2.gameid join student as t3 on t3.stuid = t1.stuid where t3.lname = 'smith' and t3.fname = 'linda' | Question: show all game names played by linda smith | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.StuID = Stude... | show all game names played by linda smith |
game_1 | select gname from plays_games as t1 join video_games as t2 on t1.gameid = t2.gameid join student as t3 on t3.stuid = t1.stuid where t3.lname = 'smith' and t3.fname = 'linda' | Question: what are the names of all games played by linda smith? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarship. | Joins: Plays_Games.... | what are the names of all games played by linda smith? |
game_1 | select t2.lname , t2.fname from sportsinfo as t1 join student as t2 on t1.stuid = t2.stuid where t1.sportname = 'football' or t1.sportname = 'lacrosse' | Question: find the last and first name of students who are playing football or lacrosse. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarshi... | find the last and first name of students who are playing football or lacrosse. |
game_1 | select t2.lname , t2.fname from sportsinfo as t1 join student as t2 on t1.stuid = t2.stuid where t1.sportname = 'football' or t1.sportname = 'lacrosse' | Question: what is the first and last name of all students who play football or lacrosse? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnScholarshi... | what is the first and last name of all students who play football or lacrosse? |
game_1 | select fname , age from student where stuid in (select stuid from sportsinfo where sportname = 'football' intersect select stuid from sportsinfo where sportname = 'lacrosse') | Question: find the first name and age of the students who are playing both football and lacrosse. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlayed, OnS... | find the first name and age of the students who are playing both football and lacrosse. |
game_1 | select fname , age from student where stuid in (select stuid from sportsinfo where sportname = 'football' intersect select stuid from sportsinfo where sportname = 'lacrosse') | Question: what are the first names and ages of all students who are playing both football and lacrosse? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, GamesPlaye... | what are the first names and ages of all students who are playing both football and lacrosse? |
game_1 | select lname , sex from student where stuid in (select t1.stuid from plays_games as t1 join video_games as t2 on t1.gameid = t2.gameid where t2.gname = 'call of destiny' intersect select t1.stuid from plays_games as t1 join video_games as t2 on t1.gameid = t2.gameid where t2.gname = 'works of widenius') | Question: find the last name and gender of the students who are playing both call of destiny and works of widenius games. | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursP... | find the last name and gender of the students who are playing both call of destiny and works of widenius games. |
game_1 | select lname , sex from student where stuid in (select t1.stuid from plays_games as t1 join video_games as t2 on t1.gameid = t2.gameid where t2.gname = 'call of destiny' intersect select t1.stuid from plays_games as t1 join video_games as t2 on t1.gameid = t2.gameid where t2.gname = 'works of widenius') | Question: what is the last name and gender of all students who played both call of destiny and works of widenius? | Tables: Student -> StuID, LName, Fname, Age, Sex, Major, Advisor, city_code. Video_Games -> GameID, GName, GType. Plays_Games -> StuID, GameID, Hours_Played. SportsInfo -> StuID, SportName, HoursPerWeek, ... | what is the last name and gender of all students who played both call of destiny and works of widenius? |
customers_and_addresses | select customer_name from customers | Question: find the name of all customers. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_details. Custome... | find the name of all customers. |
customers_and_addresses | select customer_name from customers | Question: what are the names of all the customers? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_details... | what are the names of all the customers? |
customers_and_addresses | select count(*) from customers | Question: how many customers are there? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_details. Customer_... | how many customers are there? |
customers_and_addresses | select count(*) from customers | Question: return the total number of distinct customers. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_d... | return the total number of distinct customers. |
customers_and_addresses | select avg(order_quantity) from order_items | Question: what is the average amount of items ordered in each order? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, othe... | what is the average amount of items ordered in each order? |
customers_and_addresses | select avg(order_quantity) from order_items | Question: find the average order quantity per order. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_detai... | find the average order quantity per order. |
customers_and_addresses | select customer_name from customers where payment_method = 'cash' | Question: what are the names of customers who use payment method 'cash'? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, ... | what are the names of customers who use payment method 'cash'? |
customers_and_addresses | select customer_name from customers where payment_method = 'cash' | Question: which customers use 'cash' for payment method? return the customer names. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became... | which customers use 'cash' for payment method? return the customer names. |
customers_and_addresses | select date_became_customer from customers where customer_id between 10 and 20 | Question: find the 'date became customers' of the customers whose id is between 10 and 20. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date... | find the 'date became customers' of the customers whose id is between 10 and 20. |
customers_and_addresses | select date_became_customer from customers where customer_id between 10 and 20 | Question: what are the dates when customers with ids between 10 and 20 became customers? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_b... | what are the dates when customers with ids between 10 and 20 became customers? |
customers_and_addresses | select payment_method from customers group by payment_method order by count(*) desc limit 1 | Question: which payment method is used by most customers? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_... | which payment method is used by most customers? |
customers_and_addresses | select payment_method from customers group by payment_method order by count(*) desc limit 1 | Question: find the payment method that is used most frequently. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_cus... | find the payment method that is used most frequently. |
customers_and_addresses | select customer_name from customers where payment_method = (select payment_method from customers group by payment_method order by count(*) desc limit 1) | Question: what are the names of customers using the most popular payment method? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_cu... | what are the names of customers using the most popular payment method? |
customers_and_addresses | select customer_name from customers where payment_method = (select payment_method from customers group by payment_method order by count(*) desc limit 1) | Question: find the name of the customers who use the most frequently used payment method. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_... | find the name of the customers who use the most frequently used payment method. |
customers_and_addresses | select distinct payment_method from customers | Question: what are all the payment methods? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_details. Custo... | what are all the payment methods? |
customers_and_addresses | select distinct payment_method from customers | Question: return all the distinct payment methods used by customers. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, othe... | return all the distinct payment methods used by customers. |
customers_and_addresses | select distinct product_details from products | Question: what are the details of all products? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_details. C... | what are the details of all products? |
customers_and_addresses | select distinct product_details from products | Question: return the the details of all products. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_details.... | return the the details of all products. |
customers_and_addresses | select customer_name from customers where customer_name like '%alex%' | Question: find the name of all customers whose name contains 'alex'. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, othe... | find the name of all customers whose name contains 'alex'. |
customers_and_addresses | select customer_name from customers where customer_name like '%alex%' | Question: which customer's name contains 'alex'? find the full name. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, othe... | which customer's name contains 'alex'? find the full name. |
customers_and_addresses | select product_details from products where product_details like '%latte%' or product_details like '%americano%' | Question: find the detail of products whose detail contains the word 'latte' or the word 'americano' | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_... | find the detail of products whose detail contains the word 'latte' or the word 'americano' |
customers_and_addresses | select product_details from products where product_details like '%latte%' or product_details like '%americano%' | Question: which product's detail contains the word 'latte' or 'americano'? return the full detail. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_na... | which product's detail contains the word 'latte' or 'americano'? return the full detail. |
customers_and_addresses | select t3.address_content from customers as t1 join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id where t1.customer_name = 'maudie kertzmann' | Question: what is the address content of the customer named 'maudie kertzmann'? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_cus... | what is the address content of the customer named 'maudie kertzmann'? |
customers_and_addresses | select t3.address_content from customers as t1 join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id where t1.customer_name = 'maudie kertzmann' | Question: return the address content for the customer whose name is 'maudie kertzmann'. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_be... | return the address content for the customer whose name is 'maudie kertzmann'. |
customers_and_addresses | select count(*) from customers as t1 join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id where t3.city = 'lake geovannyton' | Question: how many customers are living in city 'lake geovannyton'? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other... | how many customers are living in city 'lake geovannyton'? |
customers_and_addresses | select count(*) from customers as t1 join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id where t3.city = 'lake geovannyton' | Question: find the number of customers who live in the city called lake geovannyton. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_becam... | find the number of customers who live in the city called lake geovannyton. |
customers_and_addresses | select t1.customer_name from customers as t1 join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id where t3.state_province_county = 'colorado' | Question: find the name of customers who are living in colorado? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_cu... | find the name of customers who are living in colorado? |
customers_and_addresses | select t1.customer_name from customers as t1 join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id where t3.state_province_county = 'colorado' | Question: what are the names of customers who live in colorado state? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, oth... | what are the names of customers who live in colorado state? |
customers_and_addresses | select city from addresses where city not in ( select distinct t3.city from customers as t1 join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id) | Question: find the list of cities that no customer is living in. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_cu... | find the list of cities that no customer is living in. |
customers_and_addresses | select city from addresses where city not in ( select distinct t3.city from customers as t1 join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id) | Question: what are the cities no customers live in? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_detail... | what are the cities no customers live in? |
customers_and_addresses | select t3.city from customers as t1 join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id group by t3.city order by count(*) desc limit 1 | Question: which city has the most customers living in? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_det... | which city has the most customers living in? |
customers_and_addresses | select t3.city from customers as t1 join customer_addresses as t2 on t1.customer_id = t2.customer_id join addresses as t3 on t2.address_id = t3.address_id group by t3.city order by count(*) desc limit 1 | Question: find the city where the most customers live. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_det... | find the city where the most customers live. |
customers_and_addresses | select distinct city from addresses | Question: retrieve the list of all cities. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_details. Custom... | retrieve the list of all cities. |
customers_and_addresses | select distinct city from addresses | Question: list all the distinct cities | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_details. Customer_A... | list all the distinct cities |
customers_and_addresses | select city from addresses where zip_postcode = 255 | Question: find the city with post code 255. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_details. Custo... | find the city with post code 255. |
customers_and_addresses | select city from addresses where zip_postcode = 255 | Question: which city is post code 255 located in? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_customer_details.... | which city is post code 255 located in? |
customers_and_addresses | select state_province_county , country from addresses where zip_postcode like '4%' | Question: find the state and country of all cities with post code starting with 4. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_... | find the state and country of all cities with post code starting with 4. |
customers_and_addresses | select state_province_county , country from addresses where zip_postcode like '4%' | Question: what are the state and country of all the cities that have post codes starting with 4. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name... | what are the state and country of all the cities that have post codes starting with 4. |
customers_and_addresses | select country from addresses group by country having count(address_id) > 4 | Question: list the countries having more than 4 addresses listed. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_c... | list the countries having more than 4 addresses listed. |
customers_and_addresses | select country from addresses group by country having count(address_id) > 4 | Question: for which countries are there more than four distinct addresses listed? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_c... | for which countries are there more than four distinct addresses listed? |
customers_and_addresses | select channel_code from customer_contact_channels group by channel_code having count(customer_id) < 5 | Question: list all the contact channel codes that were used less than 5 times. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_cust... | list all the contact channel codes that were used less than 5 times. |
customers_and_addresses | select channel_code from customer_contact_channels group by channel_code having count(customer_id) < 5 | Question: which contact channel codes were used less than 5 times? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_became_customer, other_... | which contact channel codes were used less than 5 times? |
customers_and_addresses | select distinct channel_code from customers as t1 join customer_contact_channels as t2 on t1.customer_id = t2.customer_id where t1.customer_name = 'tillman ernser' | Question: which contact channel has been used by the customer with name 'tillman ernser'? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, date_... | which contact channel has been used by the customer with name 'tillman ernser'? |
customers_and_addresses | select distinct channel_code from customers as t1 join customer_contact_channels as t2 on t1.customer_id = t2.customer_id where t1.customer_name = 'tillman ernser' | Question: find the contact channel code that was used by the customer named 'tillman ernser'. | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, d... | find the contact channel code that was used by the customer named 'tillman ernser'. |
customers_and_addresses | select max(t2.active_to_date) from customers as t1 join customer_contact_channels as t2 on t1.customer_id = t2.customer_id where t1.customer_name = 'tillman ernser' | Question: what is the 'active to date' of the latest contact channel used by 'tillman ernser'? | Tables: Addresses -> address_id, address_content, city, zip_postcode, state_province_county, country, other_address_details. Products -> product_id, product_details. Customers -> customer_id, payment_method, customer_name, ... | what is the 'active to date' of the latest contact channel used by 'tillman ernser'? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.