E-R MODEL
The Entity-Relationship (E-R) model is a conceptual data model used in database design to visually represent the relationships between entities (objects, concepts, or things) within a system. This model was introduced by Peter Chen in 1976 and has since become a widely used tool for database designers and developers.
Key Components of the E-R Model:
- Entities:
- Entities represent objects, concepts, or things in the real world that can be uniquely identified. For example, in a university database, entities could include "Student," "Course," and "Faculty."
- Attributes:
- Attributes are properties or characteristics of entities. Each entity has a set of attributes that describe its properties. For instance, a "Student" entity might have attributes like "StudentID," "FirstName," and "LastName."
- Relationships:
- Relationships describe how entities are related to each other. They illustrate the connections and associations between different entities. For example, a "Student" entity may have a relationship with a "Course" entity through the "Enrolls in" relationship.
- Cardinality:
- Cardinality defines the number of instances of one entity that can be associated with another entity. It specifies the relationship between entities in terms of one-to-one, one-to-many, or many-to-many.
- Weak Entities:
- Weak entities are entities that do not have a primary key attribute of their own and rely on a relationship with another entity for identification.
- Keys:
- Keys uniquely identify instances of an entity. A primary key is a unique identifier for an entity, and a foreign key is a reference to the primary key of another entity.
Notation in E-R Diagrams:
- Entities are represented as rectangles.
- Attributes are represented inside ellipses connected to their respective entities.
- Relationships are represented as diamond shapes, connecting related entities.
- Cardinality is indicated using lines and symbols such as "1" and "M" to represent one-to-many relationships.