Files
Streamlit_NBA/dbt_nba/reports/sources/nba/season_summary.sql
T
nprasad2077 3d5de1dc3e
test / test (push) Successful in 9s
complete app
2026-09-17 17:39:22 -05:00

12 lines
451 B
SQL

select
s.season_display,
count(*) as total_games,
sum(case when g.is_overtime then 1 else 0 end) as overtime_games,
sum(case when g.is_playoff then 1 else 0 end) as playoff_games,
round(avg(g.total_points), 1) as avg_total_points,
round(avg(g.point_differential), 1) as avg_margin
from main_marts.fct_game_results g
left join main_marts.dim_seasons s on g.season_key = s.season_key
group by s.season_display
order by s.season_display desc