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
How many hours of role-playing games were played?
assistant
SELECT SUM( hours_played ) FROM Plays_games AS T1 JOIN Video_games WHERE GType = 'Role-playing game';
human
What game had the most hours played?
assistant
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;
human
Who played the most hours of Works of Widenius?
assistant
SELECT stuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid WHERE t2.GName = 'Works of Widenius' ORDER by hours_played desc LIMIT 1;
human
How many students play Works of Widenius?
assistant
SELECT COUNT( distinct t1.StuID ) FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid WHERE t2.GName = 'Works of Widenius';
human
What game type is Works of Widenius?
assistant
SELECT GType FROM Video_games WHERE GName = "Works of Widenius" ;