human
Schema:
club (Club_ID, name, Region, Start_year)
club_rank (Rank, Club_ID, Gold, Silver, Bronze, Total)
player (Player_ID, name, Position, Club_ID, Apps, Tries, Goals, Points)
competition (Competition_ID, Year, Competition_type, Country)
competition_result (Competition_ID, Club_ID_1, Club_ID_2, Score)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the minimum and mean values of the points?
assistant
SELECT MIN( points ) , AVG ( points ) FROM player;
human
What are the player names of those who have fewer points than the average?
assistant
SELECT name FROM player WHERE points < ( SELECT AVG ( points ) FROM player );
human
How many are there?
assistant
SELECT COUNT( * ) FROM player WHERE points < ( SELECT AVG ( points ) FROM player );
human
How many players are there whose points are lower than 30?
assistant
SELECT COUNT( * ) FROM player WHERE points < 30;
human
Among those, how many players are there for each position?
assistant
SELECT COUNT( * ) , POSITION FROM player WHERE points < 30 GROUP BY POSITION ;