human
Schema:
list (LastName, FirstName, Grade, Classroom)
teachers (LastName, FirstName, Classroom)
Please answer with SQL.
assistant
Sure, I understand.
human
Which classrooms are used by grade 4?
assistant
SELECT DISTINCT classroom FROM list WHERE grade = 4
human
For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.
assistant
SELECT DISTINCT classroom , grade FROM list
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 all the teachers that teach in classroom 110.
assistant
SELECT firstname FROM teachers WHERE classroom = 110
human
Find the grade studying in room 105.
assistant
SELECT DISTINCT grade FROM list WHERE classroom = 105
human
Find the grade taught in classroom 103.
assistant
SELECT DISTINCT grade FROM list WHERE classroom = 103 ;