Write a query that counts the number of 300lb+ players for each of the following regions: West Coast (CA, OR, WA), Texas, and Other (Everywhere else).

Solution:

select case when state in ('OR','WA','CA') then 'West Coast'
when state = 'TX' then 'Texas'
else 'Other' END as region,
count(1) as players
from benn.college_football_players
where weight >= 300
group by 1;

Link

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store