Database: game_1

Question: How many video games do you have?
SQL: SELECT count(*) FROM Video_games

Question: What is the count of different game types?
SQL: SELECT count(DISTINCT gtype) FROM Video_games

Question: What are the different types of video games?
SQL: SELECT DISTINCT gtype FROM Video_games

Question: What are the names of all the video games and their types in alphabetical order?
SQL: SELECT gname ,  gtype FROM Video_games ORDER BY gname

Question: What are the names of all video games that are collectible cards?
SQL: SELECT gname FROM Video_games WHERE gtype  =  "Collectible card game"

Question: What type of game is Call of Destiny?
SQL: SELECT gtype FROM Video_games WHERE gname  =  "Call of Destiny"

Question: Count the number of video games with Massively multiplayer online game type .
SQL: SELECT count(*) FROM Video_games WHERE gtype  =  "Massively multiplayer online game"

Question: What are the types of video games and how many are in each type?
SQL: SELECT gtype ,  count(*) FROM Video_games GROUP BY gtype

Question: What type has the most games?
SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1

Question: What is the type with the fewest games?
SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1

Question: What are the ids of all students who live in CHI?
SQL: SELECT StuID FROM Student WHERE city_code  =  "CHI"

Question: What are the ids of all students who have advisor number 1121?
SQL: SELECT StuID FROM Student WHERE Advisor  =  1121

Question: What are the first names for all students who are from the major numbered 600?
SQL: SELECT Fname FROM Student WHERE Major  =  600

Question: What are the average, minimum, and max ages for each of the different majors?
SQL: SELECT major ,  avg(age) ,  min(age) ,  max(age) FROM Student GROUP BY major

Question: What are the advisors
SQL: SELECT advisor FROM Student GROUP BY advisor HAVING count(*)  >=  2

Question: How many different types of sports do we offer?
SQL: SELECT count(DISTINCT sportname) FROM Sportsinfo

Question: How many different students are involved in sports?
SQL: SELECT count(DISTINCT StuID) FROM Sportsinfo

Question: What are the ids for all sporty students who are on scholarship?
SQL: SELECT StuID FROM Sportsinfo WHERE onscholarship  =  'Y'

Question: What are the last names for all scholarship students?
SQL: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID  =  T2.StuID WHERE T1.onscholarship  =  'Y'

Question: What is the total number of games played?
SQL: SELECT sum(gamesplayed) FROM Sportsinfo

Question: What is the total number of all football games played by scholarship students?
SQL: SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname  =  "Football" AND onscholarship  =  'Y'

Question: How many students play each sport?
SQL: SELECT sportname ,  count(*) FROM Sportsinfo GROUP BY sportname

Question: What are the ids of all students along with how many sports and games did they play?
SQL: SELECT StuID ,  count(*) ,  sum(gamesplayed) FROM Sportsinfo GROUP BY StuID