human
Schema:
list (LastName, FirstName, Grade, Classroom)
teachers (LastName, FirstName, Classroom)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the grade studying in room 105.
assistant
SELECT DISTINCT grade FROM list WHERE classroom = 105
human
How many teachers does the student named MADLOCK RAY have?
assistant
SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'MADLOCK' AND T1.lastname = 'RAY'
human
Find the first names of all the teachers that teach in classroom 110.
assistant
SELECT firstname FROM teachers WHERE classroom = 110
human
Find the first names of students studying in room 108.
assistant
SELECT firstname FROM list WHERE classroom = 108
human
What are the first names of students studying in room 107?
assistant
SELECT DISTINCT firstname FROM list WHERE classroom = 107
human
What are the last names of students in room 111?
assistant
SELECT lastname FROM list WHERE classroom = 111 ;