The objective is to design an Entity-Relationship Diagram for a company that has addresses, telephones, emails and representants. Here's the list of the constraints:
- a company has one or more telephones
- a company has one or more e-mails
- a company has one or more address
- an address has one or more representants
- a representant has one or more telephones
- a representant has one or more e-mails
- if a representant is removed, then it must be saved in a list "last representants".
Other constraints are (hopefully) represented in the diagram, using the following notation:
- circle: attribute
- double-lined rectangle: weak entities
- double-line: total participation
- line ending with an arrow: cardinality 1:N (arrow points to the "1")
Entity Relationship Diagram
I designed that diagram. I'm sure there are some bad design points, because I'm a beginner, and I would like to hear your opinions, suggestions and criticisms.
(based on the answer by miracle173)
English is not my native language, I should've told that in my question, so please excuse my poor word picking. By representant I mean a person that will speak on behalf of the company. With telephones I mean one or more phone numbers. With emails I mean one or more email addresses.
Here is why I chose telephone and email as being weak entities: when a company is removed, I want the list of telephones numbers and the list of emails addresses associated with that company to be also removed. Did I achieve that goal with the use of weak entity?
An address of a company can have more than one representant, but the representant can only work for one company at a time (hence the restriction in my diagram). I agree, some singular and some plural is bad practice. I will fix that.
Changing the relation to more precise verb, like "represented by" (instead of "an address has representants"): from top to bottom, one can read "An address is represented by representants"; from bottom to top, it gives incorrect reading ("A representant is represented by a company"), when it should be "A representant represents a company". So I think it makes difference the reading direction.
What is wanted with "it must be saved" is: to have a short list, like a small history, of the last representants that worked for the company. Example: If John - which is a representant of Miracle's Corporation - suddenly is fired from the company, he should be removed from the Representants list (along with his phone numbers and email addresses), but it is desired to keep him in that short history list after his deletion from Representants.