select e.mark, course, g.name, s.name, lastname, surname, p.name, f.name from students s
left join groupa g on s.group_id = g.id
inner join exam_mark e on s.id = e.student_id
inner join peciality p on g.peciality_id = p.id
inner join facult f on p.facult_id = f.id
where e.mark >= 4 and e.mark <> 2