Can I somehow Improve the relationships between tables in the following sample?
Asssuming that I have understood the problem, the following picture describes (a part of) your database, in which an arrow from A to B corresponds to a foreign key from table Ato table B:



Actually, there is a redundancy in that Grades are referred both by Groups and Subjects and each class must have the same grade if it is accessed through one of the two relations. 

I think that in a case like this you have two options:


Keep this schema, and check, maybe with a trigger, that when you insert a class it refers to a course and a subject with the same grade, or
change the schema, removing from Subject the foreign key to Grade, and, if you need to find the grade of a certain subject, joining that table with classes, courses and grades. In this way you simplify the situation, but you could create subjects not tied to specific grades.


I have a light preference for the first solution: in both of them, however, it is important that the objects in tables Grade, Subject, Course and Classes be inserted with great attention to not cause inconsistencies. The best way to do this is to define in the database stored procedures to operate on more than one object and/or perform all the proper checks, and require that the application(s) use only them, without inserting explicitly records.