Database: game_1

Question: What are the student IDs for everybody who worked for more than 10 hours per week on all sports?
SQL: SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek)  >  10

Question: What is the first and last name of the student who played the most sports?
SQL: 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 sport with the most scholarship students?
SQL: SELECT sportname FROM Sportsinfo WHERE onscholarship  =  'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1

Question: What are the ids of all students who don't play sports?
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo

Question: What are the student ids for those on scholarship in major number 600?
SQL: SELECT StuID FROM Student WHERE major  =  600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship  =  'Y'

Question: What are the ids of all female students who play football?
SQL: SELECT StuID FROM Student WHERE sex  =  'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname  =  "Football"

Question: What are the ids of all male students who do not play football?
SQL: SELECT StuID FROM Student WHERE sex  =  'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname  =  "Football"

Question: What is the total number of hours per work and number of games played by David Shieber?
SQL: 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 week and number of games played by students under 20?
SQL: SELECT sum(hoursperweek) ,  sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T2.age  <  20

Question: How many different students play games?
SQL: SELECT count(DISTINCT StuID) FROM Plays_games

Question: What are the ids of all students who are not video game players?
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games

Question: What are the ids of all students who played video games and sports?
SQL: SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games

Question: What are ids and total number of hours played for each game?
SQL: SELECT gameid ,  sum(hours_played) FROM Plays_games GROUP BY gameid

Question: What are the ids of all students and number of hours played?
SQL: SELECT Stuid ,  sum(hours_played) FROM Plays_games GROUP BY Stuid

Question: What is the name of the game that has been played the most?
SQL: 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 are the names of all the games that have been played for at least 1000 hours?
SQL: 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