I think you first need to clarify what is the relationship between student and courses and between a group and a course.
I suppose that it is clear that a group has many students and a student can be in many groups.
However if you relate group with course, student with course, and student with group, I think that you can't enforce the integrity of your database then.
Lets say Group A will have only the course Science and Joe is in Group A. Nothing stops you at database level from making the mistake of connecting Joe with the course of Art, a course that he's not following because he's not in the Art Group (Group B).
In your initial text you said,
Quote:
|
Originally Posted by roxys
1.Students can enroll themself for 1 or more courses. And a course can be taken from 1 or more students.
...
3. The students will be divided in groups. So 1 students can be in 1 or more groups and a group can consist of 1 or more students.
...
The relationship between Group and Course I have it as a 1 to many relationship, because 1 course can be given to many groups, ( example the course Basic of Accounting can be given to Group A and Group B) But in a group can only 1 course be given. (example in Group A can only Research be given)
|
This is why I have the table Student_Group which is more or less the same as Student_Course. All that I'm saying is that you shouldn't have both.
In your schema though you didn't have both.
I changed the relationship between the Teacher and the Course as well.
Please note that I'm no expert in Database Design, I know there are people on this forum with much more experience than me.