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
For each student id, how many hours did each student play?
assistant
SELECT hours_played FROM Plays_games GROUP BY Stuid;
human
How much did they play in total?
assistant
SELECT SUM( hours_played ) FROM Plays_games GROUP BY Stuid;
human
Also, what are their student ids?
assistant
SELECT Stuid , SUM( hours_played ) FROM Plays_games GROUP BY Stuid ;