An Entity merely represents something you want to keep a list of. Two lists can exist that have a relationship with each other - for example Student (a list) enrols in (a relationship) Course (a list). Of course a student can enrol in many courses and a course can have many students enroled in it. Therefore the relationship between Student to Course is "many to many". Many to many relationships between entitities in a relational database management system are resolved by placing a third entity between the entities involved. In ER diagrams this is noted by drawing a box around the relationship diamond - thus promoting the relationship to an "associative entity". The cardinality of the two orignial entities ("many to many") is removed. New cardinality ("one to many") between the outer entities (Student and Course) and the associative entity (Student.Course) with the many towards the associative entity. The data in the associative entity - from the above example - tells us which student is enrolled in which course. (In the following illustration, please ignore underscores. They just space the words out. "{" and "}" denote many) : Entity_____Associative Entity____Entity : STUDENT -------{STUDENT.COURSE }----COURSE : Fred_________ Fred.Math__________ Math : Sally_________ Fred.Science________Science : Gus__________Gus.Math___________Cooking : _____________Gus.Cooking : _____________Sally.Math : In a real database the values recorded in the STUDENT.COURSE table would not be student names and course titles. They would be the primary key values from the STUDENT and COURSE tables. The benefits of this design are:
1) The student is only recorded once which helps minimise data errors.
2) The course is only recorded once which helps minimise data errors.
3) Students can enrol in many courses and courses can have many students enrolledd.
A relationship with attributes should be an associative entity when: - All relationships for the associative entity should be many - The associative entity could have meaning independent of the other entities - The associative entity should have attribute(s), but it may or may not have an identifier - The associative entity may participate in other relationships other than the entities of the associated relationship - Ternary relationships should be converted to associative entities
many to many
Associative entities are used in Entity-Relationship (ER) models to represent relationships between two or more entities. They help to model complex relationships that have attributes of their own. By using associative entities, we can accurately capture the associations between the main entities and represent them in a clear and normalized way.
Entity-Relationship diagrams are useful for modelling data and the relationships between the data. They can be used when the constraints between data are relatively simple. They do not allow specification of interactions between the data or model how the data changes (there are no processes in Entity-Relationship). Entity-Relationship diagrams are most often used to model databases.
mandatory and optional
A relationship between instances of a single entity type is called a self-relationship or recursive relationship. This type of relationship occurs when an entity is related to other instances of the same entity type within the same entity set.
If you have a many-to-many relationship between two entities you create an intermediate entity between.Now, the relationship between the first entity and intersection entity is one-to-many, and the relationship between the second entity and intersection entity is one-to-many also.
ENHANCED ENTITY RELATIONSHIP OR EXTENDED ENTITY RELATIONSHIP
An entity relationship diagram for hotel reservation systems is a map of each entity or thing that has a part in the process of hotel reservations. The diagram maps the relationship between each entity of the process.
it is an entity whose primary key is composed of the combination of the primary keys of the entities that must be linked. It is used in linking tables of the M:N relationship that needs to be converted into two 1:M relationship for your database
An entity relationship diagram (ERD) represents the entities, or groups of information, and their relationships maintained for a business. An entity relationship diagram represents the entities, or groups of information, and their relationships maintained for a business. An entity relationship diagram represents the entities, or groups of information, and their relationships maintained for a business.
In contrast to the strong or regular entity, a weak entity is one that meets two conditions: 1. The entity is existence-dependent; that is, it cannot exist without the entity with which it has a relationship. 2. The entity has a primary key that is partially or totally derived from the parent entity in the relationship.