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 is the average age of all the male students (sex with M) from each city?
assistant
SELECT AVG ( age ) , city_code FROM student WHERE sex = 'M' GROUP BY city_code;
human
What are the average number of all the male students (sex with M) from each city?
assistant
SELECT COUNT( * ) , city_code FROM student WHERE sex = 'M' GROUP BY city_code;
human
What are the names of the students from ATL? | Here are the first and last names of the student from ATL | What is his age?
assistant
SELECT Age FROM student WHERE city_code = "ATL" ;