What is the E-R model?
E-R ( Entity Relationship ) model
- An E-R model was proposed by Peter Chen in 1971.
- An Entity-relationship model describes the structure of a database.
- An ER model is a design or blueprint of a database.
- An E-R model is a high-level data model. it is used to define the data elements and relationships for a specified system.
- An ER model defines the conceptual view of a database.
ER Diagram
Suppose we design a college database. In this database, the student and college will be an entity with attributes like address, name, id, age, clg_id, clg_name, etc.
Geometric shapes and their meaning in an E-R Diagram:-
Rectangle: Represents Entity sets.
Ellipses: Attributes
Diamonds: Relationship Set
Lines: They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses: Multi-valued Attributes
Dashed Ellipses: Derived Attributes
Double Rectangles: Weak Entity Sets
Components of an ER Diagram
there are three basic concepts
- Entities
- Attribute
- Relationship
Entities: A real-world thing either living or non-living that is easily recognizable and nonrecognizable. An entity may be any object, class, person, or place. an entity can be represented as rectangles.
Attribute: The attribute is used to describe the property of an entity. Eclipse is used to represent an attribute.
For example, id, age, name, address, clg_id, clg_name, etc. can be attributes of a student and college.
Relationship: A relationship is used to describe the relation between entities. Diamond is used to representing the relationship.
Types of relationships: there are many types of relationships.
- one–to–one relationship
- one–to–many relationships
- many–to–one relationship
- many – to – many relationships