There was a problem finding this report.

Query 1

SQL CASE Practice Problem 6
February 5, 2014 · Refreshed about 4 hours ago
Description
This report is the solution to a practice problem from Mode's SQL Tutorial lesson on using CASE, which can be found here: https://community.modeanalytics.com/sql/tutorial/sql-case/

Collaborators

Run History
SELECT state, COUNT(CASE WHEN year = 'FR' THEN 1 ELSE NULL END) AS fr_count, COUNT(CASE WHEN year = 'SO' THEN 1 ELSE NULL END) AS so_count, COUNT(CASE WHEN year = 'JR' THEN 1 ELSE NULL END) AS jr_count, COUNT(CASE WHEN year = 'SR' THEN 1 ELSE NULL END) AS sr_count, COUNT(1) AS total_players FROM benn.college_football_players GROUP BY state ORDER BY total_players DESC
SELECT state, COUNT(CASE WHEN year = 'FR' THEN 1 ELSE NULL END) AS fr_count, COUNT(CASE WHEN year = 'SO' THEN 1 ELSE NULL END) AS so_count, COUNT(CASE WHEN year = 'JR' THEN 1 ELSE NULL END) AS jr_count, COUNT(CASE WHEN year = 'SR' THEN 1 ELSE NULL END) AS sr_count, COUNT(1) AS total_players FROM benn.college_football_players GROUP BY state ORDER BY total_players DESC
<div class="mode-header embed-hidden"> <h1>{{ title }}</h1> <p>{{ description }}</p> </div> <div class="container mode-grid"> <div class="row"> <div class="col-md-12"> <mode-table id="table_8e735407f951" dataset="dataset" options="table_options"></mode-table> </div> </div> </div>
{{ dataSourceName(params.queryId) }}

The dataset is too large to view in browser Looks like something went wrong with your query.

{{ DS.queryRuns[params.queryId].errorMessage }}
This query was cancelled