I am working on creating a simple exam system, in which you are going to be basically able to store students, classes, exams, questions and scores(and some other stuff that those depend on). I am also using Entity Framework code-first.
I am using inheritance for the
Instructor classes, which derive from the
Person class. In SQL that it represented by a single People table containing a Discriminator column, as well as columns, representing each of the fields of both classes.
Here is a picture of my database diagram:
It is my first time designing a database this complicated and am really not sure if I have done everything right (specifically worried about circular references). I would really appreciate it if you could take a quick look and tell me if you see anything wrong.
Thanks a lot for the answer, mgw854.
The inconsistent naming is because of Entity Framework. I am using code first so it names the columns that it auto-generates(the foreign keys) as it pleases. If you could tell me a how to fix it, I will.
About the Student to Class relationship, it is kinda weird why EF generated it that way. It is probably because I forgot to include a collection of students inside the Class class :D
Also yes, now that I think about it, it definitely would be better if I added a Value column to each question which indicates how many points it gives you and then just use that to calculate the score on runtime.
Thanks for the help. I will fix those ASAP.
PS: I am not going to mark the question as answered, because I want to see some more suggestions, if that's ok with you :)
So I have made the changes and updated the diagram image. Looking for a way to make EF generate column names without underscores without having to write each name manually.
Just found how to fix the naming conventions in a nice way (EF custom naming convention).
Diagram updated again.