what is the id of the dorm that has the most amenities?
select t3.dormid from dorm as t3 join has_amenity as t4 on t3.dormid = t4.dormid join dorm_amenity as t5 on t4.amenid = t5.amenid group by t3.dormid order by count(*) desc limit 1
what is its name?
select t3.dorm_name from dorm as t3 join has_amenity as t4 on t3.dormid = t4.dormid join dorm_amenity as t5 on t4.amenid = t5.amenid group by t3.dormid order by count(*) desc limit 1
how many students are living in that dorm?
select count(*) from student as t1 join lives_in as t2 on t1.stuid = t2.stuid where t2.dormid in (select t3.dormid from dorm as t3 join has_amenity as t4 on t3.dormid = t4.dormid join dorm_amenity as t5 on t4.amenid = t5.amenid group by t3.dormid order by count(*) desc limit 1)
find their first names.
select t1.fname from student as t1 join lives_in as t2 on t1.stuid = t2.stuid where t2.dormid in (select t3.dormid from dorm as t3 join has_amenity as t4 on t3.dormid = t4.dormid join dorm_amenity as t5 on t4.amenid = t5.amenid group by t3.dormid order by count(*) desc limit 1)