Problem:
An instructor has decided that he needs a relational database to store grades in. He has defined the following three entities: STUDENT, COURSE, and ASSIGNMENT. What kind of relationship exists between these entities?
Create an entity relation diagram (ERD) for the instructor’s data-base. Don’t worry about the attributes, but give each entity a primary key attribute. Remember to watch out for many-to-many relationships.
Solution:
Part1:
The entities STUDENT, COURSE and ASSIGNMENT are related to each other in the following ways:
- Each STUDENT “enrolls for” at least one or more COURSE.
- Each COURSE “has” at least one or more ASSIGNMENT.
- As the STUDENT is enrolled for a COURSE, he/she need to “submit” and “score on” all the ASSIGNMENTs under all his/her COURSEs.
All the above relationships are many-to-many.
Part2:
The following diagram shows the entity relationship diagram.