turbot/nba

Query: nba_top_10_team_by_total_wins

Usage

powerpipe query nba.query.nba_top_10_team_by_total_wins

SQL

select
team_name_home,
sum(case when wl_home = 'W' then 1 else 0 end + case when wl_away = 'W' then 1 else 0 end) as total_wins
from
game
group by
team_name_home
order by
total_wins desc
limit 10;

Dashboards

The query is used in the dashboards: