ER Model in DBMS

Introduction to the ER Model:

  • The Entity-Relationship (ER) Model is predicated on the idea of actual entities and their interrelationships.
  • The Entity Relationship Model (ER Model) generates entity sets, relationship sets, general characteristics, and constraints by incorporating real-world scenarios into the database model.
  • The ER Model works best when applied to a database’s conceptual design.
  • ER Model in DBMS is based on
    • Entities and their attributes.  
    • Relationships among entities.
types of er model in dbms

Entity:

  • A real-world entity with properties referred to as attributes is called an entity in an ER model.
  • Each property is identified by its domain, or collection of values.
  • For instance, a student is regarded as an entity in a school database. The characteristics of a student include name, age, class, etc. 
entity in dbms

Strong Entity:

  • Strong entities in the schema are independent of one another.
  • A powerful creature consistently possesses a primary key.
  • One rectangle is used to symbolize strong entities.
  • One diamond represents the relationship between two powerful entities. 

Weak Entity:

  • To survive, a weak entity depends on a powerful entity.
  • Unlike strong entities, weak entities do not have a primary key.
  • A double rectangle is used to indicate a weak entity.
  • A double diamond symbolizes the relationship between one strong and one weak entity. 
strong and weak entity in dbms

Attributes:

  •  Attributes are the properties of entities. 
  • Ellipses are used to symbolize attributes.
  • Each ellipse denotes a single property and is associated with a rectangle, which is its entity. 
Attributes in dbms

Key Attribute:

  • An entity from an entity collection can be uniquely identified by its key attribute.
  • A student can be uniquely identified from a group of students using their student roll number, for instance.
  •  Similar to other characteristics, the key attribute is represented by an oval, but its content is highlighted. 
Key Attribute in DBMS

Composite Attribute:

  • When attributes are composite, they are represented by a hierarchical structure akin to a tree.
  • Each link is then linked to its corresponding attribute.
  • In other words, ellipses joined by ellipses indicate composite qualities. 
Composite Attribute in DBMS

Multivalued Attributes:  

  • More than one value  
  • We depict multivalued attributes with a double ellipse.
Multivalued Attribute in DBMS

Derived Attributes:  

  • This attribute is derived from another attribute.  
  • We depict derived attributes with a dashed ellipse.
Derived Attribute in DBMS

Relationship

  • Relationships are the result of logical associations between things.
  • Many mappings exist between relationships and entities.
  • Defining the number of associations between two things is done by mapping cardinalities.
  • Mapping cardinalities:
  • One to One
one to one relationship in DBMS
  • One to Many
one to many relationship in DBMS
  • Many to One
many to one relationship in DBMS
  • Many to Many
many to many relationship in DBMS

Participation Constraints:  

  • Total Participation − Each entity is involved in the relationship. Double lines represent total participation.  
  • Partial participation − Not all entities are involved in the relationship. Single lines represent partial participation.
Participation Constraints in DBMS

Additional Features of the ER Model: 

Generalization:

  • The ER Model allows for a hierarchical representation of database entities.
  • Generalization refers to moving ahead in this hierarchy.
  • To portray a broader perspective, entities are combined. 
Generalization in DBMS

Specialization:

  • Specialization is the reverse of generalization.  
  • In specialization, a collection of things is separated into sub-groups depending on their features. 
Specialization in DBMS

Inheritance:

  • One crucial aspect of generalization and specialization is inheritance.
  • It permits attributes from higher-level entities to be inherited by lower-level entities.
Inheritance in DBMS

Aggregation: 

  • Aggregation occurs when two separate entities combine to form a unified whole because neither entity can understand their relationship independently.
Aggregation in DBMS

Conceptual Design with ER Model: 

  • Creating an ER diagram offers several options, such as these:
  1. Is it better to model an idea as a property or entity?
  2. Is it better to model an idea as a relationship or entity?
  3. Which entity sets participate in the relationship sets? Is it better to employ ternary or binary relationships?
  4. Is aggregation appropriate here? 

ER Diagram for Organization: 

Example of ER Diagram for Organization in DBMS
Scroll to Top