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
How many unique competition types are there?
assistant
SELECT COUNT( distinct Competition_type ) FROM competition;
human
How many competitions are there for each type?
assistant
SELECT Competition_type , COUNT( * ) FROM competition GROUP BY Competition_type;
human
What are the top 3 competition types?
assistant
SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT( * ) DESC LIMIT 3 ;