human
Schema:
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)
Please answer with SQL.
assistant
Sure, I understand.
human
Which game type has most number of games?
assistant
SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1
human
Show all video game types and the number of video games in each type.
assistant
SELECT gtype , count(*) FROM Video_games GROUP BY gtype
human
How many video games exist?
assistant
SELECT count(*) FROM Video_games
human
Show all video game types.
assistant
SELECT DISTINCT gtype FROM Video_games
human
How many video game types exist?
assistant
SELECT count(DISTINCT gtype) FROM Video_games
human
What are the names of all the video games and their types in alphabetical order?
assistant
SELECT gname , gtype FROM Video_games ORDER BY gname ;