Skip to content

Amon-Ra St. Brown season totals, 2024

Level 1 · Challenge 7
Starter

Prompt

Return Amon-Ra St. Brown’s 2024 regular-season totals: games played, receptions, receiving yards, receiving touchdowns, average yards per game, and his single best game (max receiving yards). One row.

Expected output

gamesreceptionsrec_yardsrec_tdsyards_per_gamebest_game
(int)(int)(int)(int)(decimal)(int)
Hint

COUNT(*) for games, SUM for the totals, ROUND(AVG, 1) for yards per game, MAX for the best game. All in one SELECT — no GROUP BY needed because the WHERE already narrows to one player-season.

Solution
SELECT
COUNT(*) AS games,
SUM(receptions) AS receptions,
SUM(receiving_yards) AS rec_yards,
SUM(receiving_tds) AS rec_tds,
ROUND(AVG(receiving_yards)::numeric, 1) AS yards_per_game,
MAX(receiving_yards) AS best_game
FROM weekly_stats
WHERE player_display_name = 'Amon-Ra St. Brown'
AND season = 2024
AND season_type = 'REG';

Sanity check: the totals should land near ARSB’s published 2024 line — roughly 1,260 yards and 12 TDs on 17 games. If your numbers are off by an order of magnitude, the WHERE filter probably let in a non-ARSB row.