E13

Students by Home State

EasyDemographics10 pts
GROUP BYCOUNTJOINpopulation filteringORDER BY
Related lesson: GROUP BY & HAVING

Scenario

The Admissions Office wants to know where the current student body comes from geographically, to plan recruitment travel. Home addresses live in dbo.ods_address, but that table holds a row for every person on file -- applicants and faculty as well as students -- so it must be joined to dbo.ods_students to count students only.

Expected output

One row per state that at least one current student lives in, with the number of students from that state, sorted by count descending. 6 rows, totalling the 150 current students.

addr_statestudent_count

Tables

ods_address ods_students

Hints

Hints are a Pro feature. Upgrade