human
Schema:
list (LastName, FirstName, Grade, Classroom)
teachers (LastName, FirstName, Classroom)
Please answer with SQL.
assistant
Sure, I understand.
human
For each classroom, report the classroom number and the number of grades using it.
assistant
SELECT classroom , count(DISTINCT grade) FROM list GROUP BY classroom
human
Find the grade studying in room 105.
assistant
SELECT DISTINCT grade FROM list WHERE classroom = 105
human
Which grade is studying in classroom 103?
assistant
SELECT DISTINCT grade FROM list WHERE classroom = 103
human
Which classrooms are used by grade 5?
assistant
SELECT DISTINCT classroom FROM list WHERE grade = 5
human
Report the total number of students for each fourth-grade classroom.
assistant
SELECT classroom , count(*) FROM list WHERE grade = '4' GROUP BY classroom
human
Find the classrooms in which grade 4 is studying.
assistant
SELECT DISTINCT classroom FROM list WHERE grade = 4 ;