--- title: fc24.fact.ist / home hide_title: true --- ```recs select * from csv.fc24_players ```

FC24 Statistics

This app hosts analyses and insights to understand the FC24 players and teams data better.


```totals select count(*) as total_players, count(distinct nationality_name) as total_countries, count(distinct club_name) as total_clubs, avg(age) as average_age, avg(height_cm) as average_height, avg(weight_kg) as average_weight, avg(overall) as average_rating, avg(wage_eur) as average_wage, avg(potential) as average_potential, avg(value_eur) as average_value from ${recs} recs ```

```player_potential select player_id as pid, 'https://cdn.fifacm.com/content/media/imgs/fc24/players/p'|| player_id::INTEGER::VARCHAR ||'.png' as img, long_name, short_name, club_name, club_position, nationality_name, player_traits, avg(overall) as overall_rating, avg(potential) as potential_rating from ${recs} recs group by 1,2,3,4,5,6,7,8 order by 9 desc limit 12 ```

Top 12 Players based on Rating

{#each player_potential as pp}
{pp.overall_rating}

{pp.short_name}

{pp.club_name} / {pp.nationality_name}

{/each}

```by_country select nationality_id, nationality_name, count(*) as total, count(distinct club_name) as total_clubs, avg(age) as average_age, avg(height_cm) as average_height, avg(weight_kg) as average_weight, avg(overall) as average_rating, avg(wage_eur) as average_wage, avg(potential) as average_potential, avg(value_eur) as average_value from ${recs} recs group by 1,2 order by 3 desc limit 20 ```

Top 20 Countries


```by_club WITH RankedClubs AS ( SELECT club.club_name, club.club_team_id, AVG(club.overall)::INTEGER AS overall, AVG(club.pace)::INTEGER as pace, AVG(club.shooting)::INTEGER as shooting, AVG(club.passing)::INTEGER as passing, AVG(club.dribbling)::INTEGER as dribbling, AVG(club.defending)::INTEGER as defending, AVG(club.physic)::INTEGER as physic, AVG(club.mentality_composure)::INTEGER as composure FROM ${recs} club GROUP BY club.club_name, club.club_team_id ORDER BY overall DESC LIMIT 20 ) SELECT 'score' as ph, club_name, club_team_id, overall, 1 - ((MAX(overall) OVER () - overall) / (MAX(overall) OVER () - MIN(overall) OVER ())) + 0.1 as rank_overall, pace, 1 - ((MAX(pace) OVER () - pace) / (MAX(pace) OVER () - MIN(pace) OVER ())) + 0.1 as rank_pace, shooting, 1 - ((MAX(shooting) OVER () - shooting) / (MAX(shooting) OVER () - MIN(shooting) OVER ())) + 0.1 as rank_shooting, passing, 1 - ((MAX(passing) OVER () - passing) / (MAX(passing) OVER () - MIN(passing) OVER ())) + 0.1 as rank_passing, dribbling, 1 - ((MAX(dribbling) OVER () - dribbling) / (MAX(dribbling) OVER () - MIN(dribbling) OVER ())) + 0.1 as rank_dribbling, defending, 1 - ((MAX(defending) OVER () - defending) / (MAX(defending) OVER () - MIN(defending) OVER ())) + 0.1 as rank_defending, physic, 1 - ((MAX(physic) OVER () - physic) / (MAX(physic) OVER () - MIN(physic) OVER ())) + 0.1 as rank_physic, composure, 1 - ((MAX(composure) OVER () - composure) / (MAX(composure) OVER () - MIN(composure) OVER ())) + 0.1 as rank_composure FROM RankedClubs ORDER BY overall DESC ```

Top 20 Clubs - Skills

{#each by_club as hm} {/each}
Club Overall Pace Shooting Passing Dribbling Defending
{hm.club_name} {hm.overall} {hm.pace} {hm.shooting} {hm.passing} {hm.dribbling} {hm.defending}