I'm trying to design an ER diagram where i have a USER and a MESSAGE entity. Users can send messages to other users. I have designed 2 alternative diagrams for this but i'm not sure which one is the correct.
This ER (Entity Relationship) Diagram represents the model of Instant Messaging System Entity. The entity-relationship diagram of Instant Messaging System shows all the visual instrument of database tables and the relations between Conference, Status, Message, User etc.
This ER (Entity Relationship) Diagram represents the model of Chat Application Entity. The entity-relationship diagram of Chat Application shows all the visual instrument of database tables and the relations between User, Group Chat, Chat, Smiles Chat etc.
Entity relationship diagram displays the relationships of entity set stored in a database. In other words, we can say that ER diagrams help you to explain the logical structure of databases. At first look, an ER diagram looks very similar to the flowchart.
Entity Relationship Diagram Example What is ER Model? ER Model stands for Entity Relationship Model is a high-level conceptual data model diagram. ER model helps to systematically analyze data requirements to produce a well-designed database.
Neither. Here we have a case of self-relationship.
Sending messages is interpreted as an event, not as an entity, even if it has attributes/properties. There is a close connection here between two entities: users, and also users. The correct case for a conceptual model in an ER-Diagram would be:
Note the cardinality here. A user may or may not have messaged others. Likewise, a user may or may not receive messages from other users.
Once you dismember it, that is, once you do the decomposition to the logical model, you end up with the following case:
"To" and "From" here represents a foreign key. This type of model results in two tables in the database. One will represent the users of the system. The other will represent the messages exchanged between users. Foreign keys here may or may not serve as a composite primary key. Me, in my opinion, I prefer the use of surrogate keys, but this is up to you.
Hope I have helped in some way. If you have further questions, please comment and I will edit my answer, or I can add a comment too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With