human
Schema:
list (LastName, FirstName, Grade, Classroom)
teachers (LastName, FirstName, Classroom)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the first names of students studying in room 108.
assistant
SELECT firstname FROM list WHERE classroom = 108
human
Which classroom has the most students?
assistant
SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1
human
Which classrooms are used by grade 5?
assistant
SELECT DISTINCT classroom FROM list WHERE grade = 5
human
Which classrooms are used by grade 4?
assistant
SELECT DISTINCT classroom FROM list WHERE grade = 4
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 ;