Entities with attributes and keys; relationships between entities.
This page includes three versions of the same ERD, consisting of (and expanding somewhat on) the example entities, relationships, and keys described in the previous sections. One ERD is a logical ERD, and is shown without data types, index indicators, or associative entities; the remaining two are physical ERDs: one uses SQLite datatypes, while the other uses H2 datatypes. All of the diagrams were created in diagrams.net, and the source files are linked below.
In examining the ERDs, can you identify a way to simplify one or more entities or relationships, to reduce redundancy?
Logically, for a student to receive a grade, the student must be registered for a course. Thus, it’s not really necessary to have two many-to-many relationships between the student and course entities. The grade entity could simply have a relationship to the student_course entity.
If we’re willing to allow for a couple of nullable attributes, we could make things even simpler: The grade entity could implement the many-to-many relationship between student and course, and we could drop the student_course associative entity altogether; with that approach, we’d have to make the recorded and score attributes nullable (since the student wouldn’t have a grade at the moment of registration, and for some time after).