title: Database design help required
body: <p>I need help in building simple database structure. Kind of stuck.</p>
  
  <p>Here's what I'm trying.</p>
  
  <p>Class means Department+Semester. Eg, Electronics Engineering SemI, Electrical Engg Sem II.. etc..</p>
  
  <p>Student is in class;
  Class has a defined group of subjects;
  Group consists of multiple subjects.</p>
  
  <p>Class and Subjects, 2 entities depend on same SubjectGroup entity. So isn't this a ternary relationship ?</p>
  
  <p>I've made this image to make picture clear.
  [ P = Primary key; F = Foreign Key; Arrows do not mean anything of One-to-many/many to many etc.. they are just showing what referenced where]</p>
  
  <p><img src="https://i.stack.imgur.com/xjKnG.png" alt="alt text"></p>
  
  <p>I am stuck because I can not refer to GroupId two times.</p>
  
  <p>How should I modify this structure ?</p>
  
  <p>-
  Thanks</p>