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, how many sports do they play?
assistant
SELECT COUNT( * ) FROM Sportsinfo GROUP BY StuID;
human
Order the information in descending order by number of sports played.
assistant
SELECT COUNT( * ) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID;
human
What is the first and last name of student who played the most?
assistant
SELECT T2.Fname , T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT( * ) DESC LIMIT 1 ;