human
Schema:
Campuses (Id, Campus, Location, County, Year)
csu_fees (Campus, Year, CampusFee)
degrees (Year, Campus, Degrees)
discipline_enrollments (Campus, Discipline, Year, Undergraduate, Graduate)
enrollments (Campus, Year, TotalEnrollment_AY, FTE_AY)
faculty (Campus, Year, Faculty)
Please answer with SQL.
assistant
Sure, I understand.
human
How many campuses are there that have degrees conferred?
assistant
SELECT COUNT( DISTINCT campus ) FROM degrees;
human
How many degrees does each campus confer?
assistant
SELECT campus , COUNT( * ) FROM degrees GROUP BY campus;
human
Which campus had the most degrees conferred in 1990?
assistant
SELECT campus FROM degrees WHERE year = 2002 GROUP BY campus ORDER BY SUM( degrees ) DESC LIMIT 1;
human
How about overall?
assistant
SELECT campus FROM degrees GROUP BY campus ORDER BY SUM( degrees ) DESC LIMIT 1 ;