Select S.StudentName , S.StudentId from StudentsPerYear as S Left outer join STUDENTS_COURSES as C On S.StudentId = C.StudentId And S.year = C.year Where And S.year = 2006 C.StudentId is null