SQL query to select all teachers not in different table
Your query using NOT IN is good, but you can also use LEFT JOIN and keep only the teachers who don't have Groups:

SELECT t.Id, FirstName, MiddleName, LastName
FROM Teachers t LEFT JOIN Groups g ON t.Id=g.TeacherId
WHERE g.TeacherId IS NULL