CREATE TABLE has_amenity (dormid DECIMAL, amenid DECIMAL)
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
CREATE TABLE dorm (dormid DECIMAL, dorm_name TEXT, student_capacity DECIMAL, gender TEXT)
CREATE TABLE lives_in (stuid DECIMAL, dormid DECIMAL, room_number DECIMAL)
CREATE TABLE dorm_amenity (amenid DECIMAL, amenity_name TEXT)

For each dorm, how many amenities does it have?
SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid
SELECT COUNT(*), "T1"."dormid" FROM "dorm" AS "T1" JOIN "has_amenity" AS "T2" ON "T1"."dormid" = "T2"."dormid" WHERE "T1"."student_capacity" > 100 GROUP BY "T1"."dormid"