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
| games | receptions | rec_yards | rec_tds | yards_per_game | best_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_gameFROM weekly_statsWHERE 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.