Skip to content

1350. Students With Invalid Departments 👍

1
2
3
4
5
6
7
SELECT
  Students.id,
  Students.name
FROM Students
LEFT JOIN Departments
  ON (Students.department_id = Departments.id)
WHERE Departments.id IS NULL;