SELECT students.id, students.lastname
FROM students
LEFT JOIN teachers ON students.id=teachers.emp_id
LEFT JOIN teacher_assistants ON students.id=teacher_assistants.emp_id
LEFT JOIN employee_name ON teachers.emp_id=employee_name.id
AND teacher_assistants.emp_id=employee_name.id
WHERE name='Nikolai' AND name='Katerina'