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
Show me all the types of competitions?
assistant
SELECT DISTINCT ( competition_type ) FROM competition;
human
show me the types of competition that have atleast five competition of that type
assistant
SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT( * ) > = 5;
human
show me the types of competition that has at most competitions of that type
assistant
SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT( * ) < = 5 ;