human
Schema:
country (Country_id, Country_name, Capital, Official_native_language)
team (Team_id, Name)
match_season (Season, Player, Position, Country, Team, Draft_Pick_Number, Draft_Class, College)
player (Player_ID, Player, Years_Played, Total_WL, Singles_WL, Doubles_WL, Team)
Please answer with SQL.
assistant
Sure, I understand.
human
Show all team names.
assistant
SELECT Name FROM Team
human
Show the season, the player, and the name of the team that players belong to.
assistant
SELECT T1.Season , T1.Player , T2.Name FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id
human
Show the position of players and the corresponding number of players.
assistant
SELECT POSITION , COUNT(*) FROM match_season GROUP BY POSITION
human
Show the draft pick numbers and draft classes of players whose positions are defenders.
assistant
SELECT Draft_Pick_Number , Draft_Class FROM match_season WHERE POSITION = 'Defender'
human
Show the most common position of players in match seasons.
assistant
SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY count(*) DESC LIMIT 1
human
Return the positions of players on the team Ryley Goldner.
assistant
SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Ryley Goldner" ;