Prompt
Across the NFC North (DET, GB, MIN, CHI), return the top 15 wide receivers by 2024 regular-season receiving yards. Show name, team, games, catches, yards, TDs, yards per catch.
Expected output
15 rows, ordered by yards descending:
| player_display_name | recent_team | games | catches | yards | tds | yards_per_catch |
|---|
Hint
GROUP BY player_display_name, recent_team. Filter position_group = 'WR'.
recent_team IN ('DET', 'GB', 'MIN', 'CHI'). LIMIT 15.
Solution
SELECT player_display_name, recent_team, COUNT(*) AS games, SUM(receptions) AS catches, SUM(receiving_yards) AS yards, SUM(receiving_tds) AS tds, ROUND(SUM(receiving_yards)::numeric / NULLIF(SUM(receptions), 0), 1) AS yards_per_catchFROM weekly_statsWHERE recent_team IN ('DET', 'GB', 'MIN', 'CHI') AND season = 2024 AND season_type = 'REG' AND position_group = 'WR' AND targets IS NOT NULL AND targets > 0GROUP BY player_display_name, recent_teamORDER BY yards DESCLIMIT 15;