human
Schema:
list (LastName, FirstName, Grade, Classroom)
teachers (LastName, FirstName, Classroom)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the last names of students studying in room 111.
assistant
SELECT lastname FROM list WHERE classroom = 111
human
Report the first name and last name of all the teachers.
assistant
SELECT DISTINCT firstname , lastname FROM teachers
human
Find the first names of students studying in room 108.
assistant
SELECT firstname FROM list WHERE classroom = 108
human
Find all students taught by MARROTTE KIRK. Output first and last names of students.
assistant
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'MARROTTE' AND T2.lastname = 'KIRK'
human
Find all students taught by OTHA MOYER. Output the first and last names of the students.
assistant
SELECT T1.firstname , T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'OTHA' AND T2.lastname = 'MOYER'
human
Show each student's first name and last name.
assistant
SELECT DISTINCT firstname , lastname FROM list ;