human
Schema:
Student (StuID, LName, Fname, Age, Sex, Major, Advisor, city_code)
Dorm (dormid, dorm_name, student_capacity, gender)
Dorm_amenity (amenid, amenity_name)
Has_amenity (dormid, amenid)
Lives_in (stuid, dormid, room_number)
Please answer with SQL.
assistant
Sure, I understand.
human
How many students are there?
assistant
SELECT COUNT( * ) FROM student;
human
How about the total number of dorms?
assistant
SELECT COUNT( * ) FROM dorm;
human
Can you list their names?
assistant
SELECT dorm_name FROM dorm;
human
How many students live in Smith Hall?
assistant
SELECT COUNT( * ) FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = "Smith Hall" ;