human
Schema:
list (LastName, FirstName, Grade, Classroom)
teachers (LastName, FirstName, Classroom)
Please answer with SQL.
assistant
Sure, I understand.
human
How many students are there in record?
assistant
SELECT COUNT( * ) FROM list;
human
What about that in terms of each grade?
assistant
SELECT grade , COUNT( * ) FROM list GROUP BY grade;
human
Also include number of classrooms.
assistant
SELECT grade , COUNT( DISTINCT classroom ) , COUNT( * ) FROM list GROUP BY grade ;