human
Schema:
College (cName, state, enr)
Player (pID, pName, yCard, HS)
Tryout (pID, cName, pPos, decision)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the maximum training hours for the students whose training hours is greater than 1000 in different positions?
assistant
SELECT max(T1.HS) , pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos
human
How many players have more than 1000 hours of training?
assistant
SELECT count(*) FROM Player WHERE HS > 1000
human
What are the names of players whose training hours is between 500 and 1500?
assistant
SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500
human
What is the average training hours of all players?
assistant
SELECT avg(HS) FROM Player
human
Find the name and training hours of players whose hours are below 1500.
assistant
SELECT pName , HS FROM Player WHERE HS < 1500
human
Find the max, average and min training hours of all players.
assistant
SELECT avg ( HS ) , MAX( HS ) , MIN( HS ) FROM Player ;