human
Schema:
list (LastName, FirstName, Grade, Classroom)
teachers (LastName, FirstName, Classroom)
Please answer with SQL.
assistant
Sure, I understand.
human
Report the first name and last name of all the teachers.
assistant
SELECT DISTINCT firstname , lastname FROM teachers
human
Which classrooms are used by grade 5?
assistant
SELECT DISTINCT classroom FROM list WHERE grade = 5
human
Find the last names of teachers teaching in classroom 109.
assistant
SELECT lastname FROM teachers WHERE classroom = 109
human
Find the first names of the teachers that teach first grade.
assistant
SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1
human
Find the first names of all the teachers that teach in classroom 110.
assistant
SELECT firstname FROM teachers WHERE classroom = 110
human
what are the last names of the teachers who teach grade 5?
assistant
SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5 ;