Entity - Relationship Model - CH2
Entity - Relationship Model - CH2
The Entity-
Relationship Model
The Entity- Relationship Model
● The weak entity doesn't contain any key attribute of its own.
The weak entity is represented by a double rectangle.
Attributes:
● Attributes are the properties which define the entity type.
● Example - A female can marry to one male, and a male can marry to one
female.
2. One-to-many relationship
● When only one instance of the entity on the left, and more than one
instance of an entity on the right associates with the relationship then this
is known as a one-to-many relationship.
● Example - Scientist can invent many inventions, but the invention is done
by the only specific scientist.
3. Many-to-one relationship
● When more than one instance of the entity on the left, and only one
instance of an entity on the right associates with the relationship then
it is known as a many-to-one relationship.
● Example - Student enrolls for only one course, but a course can have
many students.
4. Many-to-many relationship
● When more than one instance of the entity on the left, and more than
one instance of an entity on the right associates with the relationship
then it is known as a many-to-many relationship.
● For binary relationship set R on an entity set A and B, there are four
possible mapping cardinalities. These are as follows:
One to one (1:1)
One to many (1:M)
Many to one (M:1)
Many to many (M:M)
One-to-one
EER Features -
● Subclass and Superclass
● Specialization and Generalization
● Union and category
● Aggregate
Super Class
● The class which is having its sub groupings called as super
class.
Example: We have 5 entities Teacher, Class, Location, Salary, Course. So, here
five entity types are associating we can say an n-ary relationship is 5.
Problems
● It specifies that each entity in the entity set may or may not
participate in the relationship instance in that relationship set.