I have created the entity-relationship diagram (ERD) shown below (for brevity, each individual bubble-shaped box portrays multiple attributes):
Considering such an ERD, I have to convert each entity type or associative entity type depicted there as a relation with its corresponding attribute names, but I run into some problems.
I usually represent a relation as follows:
X = (a, b, c)*
X is the name of the relation and
c are the names of its attributes.
Then, in the business domain that I am working on, a
Course depends on zero-to-many (0:M) other
Courses (as portrayed in the ERD). This means that a
Course should be connected somehow to the
Courses it is dependent on.
So, how can I represent this situation as a (mathematical) relation?
I have tried the following:
Course = (course_number, course_name, course_dependencies?)
I think it is possible to depict the desired aspect in another way, e.g.:
Depends = (course_name)
Course = (course_number, course_name, depends)
But I thought about, maybe, arranging the elements as follows:
Course = (course_number, course_name)
Depends = (course_name_depender, course_name_dependee)
In this way, each pair of attribute names in the relation called
Depends represents the association (or relationship) between two occurrences of the relation entitled
Which of these options is the right way to do it? Perhaps there is a better approach?