CREATE TABLE Apartment_Facilities (apt_id VARCHAR, facility_code VARCHAR)
CREATE TABLE Apartments (room_count INT, apt_id VARCHAR)

Show the total number of rooms of all apartments with facility code 'Gym'.
SELECT SUM(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym"
SELECT SUM("T2"."room_count") FROM "Apartment_Facilities" AS "T1" JOIN "Apartments" AS "T2" ON "T1"."apt_id" = "T2"."apt_id" WHERE "Gym" = "T1"."facility_code"