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
What are the number of games played for students under the age of 20?
assistant
SELECT SUM( gamesplayed ) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20;
human
What are the total hours per week students under the age of 20 played games?
assistant
SELECT SUM( hoursperweek ) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20;
human
What is the most common sport name those students played?
assistant
SELECT sportName , COUNT( * ) FROM sportsinfo WHERE stuid IN ( SELECT stuid FROM student WHERE age < 20 ) GROUP by sportname ORDER by COUNT( * ) desc LIMIT 1 ;