Find number of students enrolled in some classes offered by each department.
select count(*), t3.dept_code from class as t1 join enroll as t2 on t1.class_code = t2.class_code join course as t3 on t1.crs_code = t3.crs_code group by t3.dept_code
Which department has the most number of students enrolled?
select * from class as t1 join enroll as t2 on t1.class_code = t2.class_code join course as t3 on t1.crs_code = t3.crs_code group by t3.dept_code order by count(*) desc limit 1
What is the corresponding department name?
select t4.dept_name from class as t1 join enroll as t2 on t1.class_code = t2.class_code join course as t3 on t1.crs_code = t3.crs_code join department as t4 on t3.dept_code = t4.dept_code group by t3.dept_code order by count(*) desc limit 1