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
what are the codes of all different cities where students are from?
assistant
SELECT distinct city_code FROM student;
human
how many students are living in city PHL?
assistant
SELECT COUNT( * ) FROM student WHERE city_code = 'PHL';
human
among them, how many are between ages 20 and 25?
assistant
SELECT COUNT( * ) FROM student WHERE city_code = "PHL" AND age BETWEEN 20 AND 25 ;