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
List all club names in ascending order of start year.
assistant
SELECT name FROM club ORDER BY Start_year ASC
human
which country did participated in the most number of Tournament competitions?
assistant
SELECT country FROM competition WHERE competition_type = 'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1
human
How many clubs are there?
assistant
SELECT count(*) FROM club
human
How many clubs have total medals less than 10?
assistant
SELECT count(*) FROM club_rank WHERE Total < 10
human
What is the average number of gold medals for clubs?
assistant
SELECT avg(Gold) FROM club_rank
human
What are the maximum and minimum number of silver medals for all the clubs?
assistant
SELECT MAX( Silver ) , MIN( Silver ) FROM club_rank ;