Company: Bree_7oct
Difficulty: medium
Count Average Players per Team In a baseball tournament every player's score is recorded. Within each team, the player with the maximum score is the team leader . A player of the team whose score is greater than or equal to 50% of the team leader's score is an average player of that team; the leader is therefore always an average player. For example, if a team leader scored 100 runs, every player of that team with a score of at least 50 is an average player. If the leader scored 101 runs, a player needs at least 50.5, so a score of 50 does not qualify but 51 does. Write an SQL query to find the number of average players in each team. Arrange the answer by team name (A-Z). Table: p_score Column Type Description p_id INTEGER Unique id of the player t_id INTEGER Id of the player's team score INTEGER Score of the player Table: t_details Column Type Description t_id INTEGER Unique id of the team t_name TEXT Name of the team Expected Output Return the following columns, in this order: Column