Junior John Junior John - 6 months ago 59
SQL Question

Designing database with entity relations

So I am new in designing databases and I'm trying to represent a db diagram for a system where students can rate professors and school. Also Students and Professors can have their account to login.
Is this a proper presentation and am I missing anything as of entity relations ?
And I wasn't sure if i need to use any inheritance as well ..

Entity Relation Diagram

  1. Enumerated columns are good indication for bad design.
    You need an additional table for values.
    Once that done, there is no need to separate school rating from professor rating -
    use a general rating table containning the id of the rater (which is always a student in your case) and the id and type (school/professor) of the rated element.

  2. I don't see any reason to put students and professors in different tables.
    Think of it as a person table with a role attribute.
    If a person can be both, than instead of the role attribute add 2 flags columns - is_student and is_professor.