I am trying to design a database management system with my PHP and intermediate MySQL knowledge, keeping normalization in mind.
These are the assumptions:
- The school has many students from grade 1 to grade 6.
- Each grade is divided into classes (e.g. we have grade 1 A, grade 1 B, grade 1 C) due to the class size.
- Grade 1 to grade 3 offer the same subjects, but from grade 4 to grade 6 users can select which courses to offer.
- Many teachers teach ONLY one subject BUT can teach MORE THAN one grade.
As an intermediate programmer, it all got twisted. I was able to create the following tables and columns
students{(id),(name),(name),(parent_id)} -student details
parents{(id),(name),(email),(phone),(address)} - parent details
teachers{(id),(name),(email),(subject_id)} - teachers details
subjects{(id),(name),(description)} - subject details
attendance{(date),(status),(student_id)} - attendance of student with id of student_id,
status in boolean TRUE = present, FALSE=absent
This is how far I have gone.
Now I want to show a table where a student can be linked to all the subjects he/she is taking and a teacher linked to all the grades (no need to specify classes) he is teaching. How can I do that?
I will appreciate it if I can be pointed in the right direction.