title: creating a class-subject database
body: <p>i want to create a school database and i am stuck up in middle. i have following tables </p>
  
  <ol>
  <li><strong>users</strong> - id, role_id, username, password</li>
  <li><strong>roles</strong> - id, role(<em>teacher/student</em>)</li>
  <li><strong>teachers</strong>- id,</li>
  <li><strong>student</strong> -  id, class_id,</li>
  <li><strong>class</strong> - id, standard_id, section</li>
  <li><strong>standard</strong> - id, name</li>
  </ol>
  
  <p>Now i wish to relate subject to teacher and student. The problem here is that </p>
  
  <ol>
  <li>Some subjects are optional and others compulsory </li>
  <li>English for 5-7th standard is compulsion but optional for 8-10 </li>
  <li>For 8th std. English is part of 3rd subject / optional group 3 for 9-10 english can be taken as subject1, subject2 or subject3 but only once and English as subject 1 is different from English as subject 2.</li>
  </ol>
  
  <p>i wish to relate students to his subjects. </p>
  
  <p>Also for 8std section A &amp; B(<em>std + section = class</em>)  English is the 3rd subject for 8c it's fixed German but 8D can have both. It would be great if this data could could also be associated in some way not necessary to same table. This is some thing like allowed subjects for class.</p>
  
  <p>i would also like to associate teacher to subject and class (teacher X takes english for 8c)</p>