I recently submitted an assignment in a group for our databases class and we lost points on one of the exercises and the correction is unclear. If someone could examine the question, the submission and the grader's comment for me and tell us what we did wrong I would greatly appreciate it.
Given a set of cities in some country, we would like to design an ER-diagram which records the distance between every pair of cities. Assume the attributes for each city is its name and its population with the name being unique, i.e., no 2 cities have the same name. Form an ER-diagram to model this application.
In this example, we see that there is a city entity set, and a country entity set. The city set has attributes of Cname, to distinguish between unique cities, and population. The relationship between country and city is “Located In” and is an M-1 relationship, because there are many cities in only one country. Additionally, city has a recursive relationship that measures the distance between a city and another unique city. The relationship between cities is “Distance” and has a M-1 relationship as well, because the distance from a single city can be compared to many other cities in a country.
The comment: "Use distance as a relation."
Any help is appreciated. Thank you!