🔍 View SQL Query
SELECT
CONCAT(p.first_name, ' ', p.last_name) AS player_name,
p.position, t.team_name,
COUNT(ps.stat_id) AS matches_played,
SUM(ps.points) AS total_points,
SUM(ps.assists) AS total_assists,
SUM(ps.rebounds) AS total_rebounds,
SUM(ps.steals) AS total_steals,
SUM(ps.blocks) AS total_blocks,
ROUND(SUM(ps.points) / COUNT(ps.stat_id), 1) AS avg_points,
ROUND(SUM(ps.assists) / COUNT(ps.stat_id), 1) AS avg_assists,
ROUND(SUM(ps.rebounds) / COUNT(ps.stat_id), 1) AS avg_rebounds
FROM player_stat ps
JOIN player p ON p.player_id = ps.player_id
LEFT JOIN team t ON t.team_id = p.team_id
GROUP BY p.player_id
ORDER BY total_points DESC
LIMIT 20;
| Rank | # | Player | Position | Team | GP | Total Pts | Avg Pts | Total Ast | Avg Ast | Total Reb | Avg Reb | Stl | Blk |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| No stats logged yet. Log player stats → | |||||||||||||