0% completed
In the ER (Entity-Relationship) model, entities, attributes, and relationships are the core components used to define the structure of a database. Understanding these concepts is essential for designing a logical and efficient database.
In this lesson, we’ll explore the symbols used in ER models, define entities and entity sets, explain different types of attributes, and introduce relationships between entities. By the end of this lesson, you’ll have a foundational understanding of how these elements work together to form a well-structured data model.
ER diagrams utilize specific symbols to make the structure of data intuitive and easy to understand:
These symbols help visualize the data model and its structure, making it easier for designers and stakeholders to understand data requirements and organization.
In the ER model, an entity is a real-world object or concept that is distinct and needs to be represented in the database. An entity is typically represented by a rectangle in ER diagrams.
For example, a Student in a school database is an entity that represents a real-world individual with data to be stored.
An entity set is a collection of similar entities that share the same attributes. For instance, the Student entity set includes all individual students, each with attributes like Student ID, Name, and Date of Birth.
Attributes are properties or details about an entity. Each entity in an entity set has the same attributes, which are represented as ellipses in ER diagrams. Attributes provide specific details about each entity instance.
A key attribute uniquely identifies each entity within an entity set, ensuring there are no duplicates.
A composite attribute consists of multiple components, each of which has its own meaning. Composite attributes can be divided into smaller attributes.
A multivalued attribute can hold multiple values for a single entity instance. Unlike single-valued attributes, which store only one value per attribute, multivalued attributes allow for a list of values.
A derived attribute is calculated from other attributes and is not stored directly in the database.
A relationship defines how two or more entities are associated. In ER diagrams, relationships are represented by diamonds connecting the related entities.
A relationship type describes the association between two or more entity types without specifying the exact instances. For example, a Student may "enroll" in a Course. This general type of connection, "enrolls in," describes how students are related to courses.
A relationship set is a collection of similar relationships between instances of entities. For example, the set of all instances of students enrolled in courses forms a relationship set for the "enrolls in" relationship type.
.....
.....
.....