1-Each class has some students.
2-Each student must study mandatory subjects and two elective subjects.
3-Each teacher teaches in one class at least.
4-Only managers have permission to know teachers salaries.
Detail #1 --- Design - Why have ClassName in StudentMaster table?
Detail #2 --- look at not exists to find the students that are not in a mandatory class
Detail #3 --- you could perform a count and gran the null count, you could left outer join and then change back to an inner join by putting where class.col is null, you could try a not exists.
Detail #4 --- take a look at LBAC, views, security in general