php - Implementing a report card generation system
I want to create a system inphp
andmysql
, that is supposed to calculate student grades and display the results, such that the school can print out a report card.
When a teacher logs onto the system, he/she will only see the students he/she teaches
I already have three tables in the database (teachers
table,students
table,subjects
table).
A teacher teaches more than one subject and a teacher teaches more than one class.
How can I implement that in the database?
Answer
Solution:
This question is not really appropriate for StackOverflow, but I will try to get you started by providing a first draft for your tables:
Teacher
Student
Subject
TeacherXSubject (association between teachers and subjects)
an unique key should be placed on (
TeacherId
,SubjectId
)Class
TeacherXClass (classes one teacher may teach)
an unique key should be placed on (
TeacherId
,ClassId
)ClassXStudent (the classes a student may attend)
For the first request: see the students he/she teaches
Give it a try and come back with more targeted questions :).