Task: Text to Code
Input (English): Step 1: For each row in Has_amenity table, find corresponding rows in Dorm table and in Dorm_amenity table.
Step 2: find amenity_name of the results of step 1 whose student_capacity greater than 300
Output (English): SELECT T2.amenity_name FROM Dorm AS T1 JOIN Dorm_amenity AS T2 JOIN Has_amenity AS T3 ON T1.dormid = T3.dormid AND T3.amenid = T2.amenid WHERE T1.student_capacity > 300