School Database Design Diagram

database-design

I want to design a database for school the output of the system have to be like this :
The system Output

So I design this Database Database Design

Is there any tips or notes that may make it better .
Thanks in advance

Best Answer

From your comments, Person represents the generic information about any person tied to this system; students, teachers, other school employees. Information that's in Person wouldn't need to be repeated in Student (name, address, DOB).

I would add the student's current grade/class (kindergarten through high school) to Student. Let's call that StudentClass; we'll use it later.

Also - you may need an intermediary table to go with MarkType and Mark. I would think you'd need something to indicate the total available points for each item (as shown in the headers of your output). MarkType makes sense as is. I would have Mark as a table indicating a particular exam, quiz, homework assignment (etc.). So, it would need:

  • MarkID (primary key)
  • MarkType
  • SubjectId
  • MarkValue - the points this specific item is worth (for example 10 points).

Then, I would have StudentMarks:

  • StudentMarkId (primary key)
  • MarkId
  • StudentId
  • Mark - the points earned on this specific item, by this student (for example one student might get 9 points out of the possible 10, other might only get 5).

I would also be inclined to decouple Term and Subject - there may be subjects that are only offered for one term. Similarly, different instructors may provide a different mix of assignments, and assign different values to a given assignment than another instructor. I would create two new tables:

Instructor: - InstructorId (primary key) - PersonID (foreign key to Person, where name, address, DOB would be) - ... (other information specific to a given instructor, regardless of the subject they're teaching, or the term/year they're teaching it in)

Course: - CourseId (primary key) - SubjectId - TermId - InstructorId

TermId would be removed from Subject, and CourseId would replace SubjectId in Mark.

Another note: it might make sense to specifically tie a student to a course. that could be called....

CourseRoster: - StudentCourseId (primary key) - StudentId - CourseId - StudentCurrentClass (the value of StudentClass at the time this student was in this class).

In that case, replace StudentId with StudentCourseId in StudentMarks.

This would even let you identify if there were exams/quizzes/assignments that a particular student in a particular course had no mark for.

UPDATE: Based on your comments, I added some fields to track the student's current "class" (K through high school), and their class when they took a specific course. consists of hard-coded values (in the US, there's kindergarten plus 12 years of education before university, so "K" and "1" - "12" would work here), the Class table shouldn't actually be needed.If you need to establish explicit classes for some reason, then the Class table would still be needed. I would reverse it, though - one class has multiple students, so put ClassID in the Student table. Note: you may want to consider tying each Class to a specific Term, as well.

Related Question