An Entity Set is a collection of similar entities in a database. In the Entity-Relationship (ER) Model, an entity represents a real-world object or concept, while an entity set is a set of entities that share the same properties (attributes) but may represent different instances of that object or concept.
In simpler terms, an entity set is a collection or group of entities that are described by the same set of attributes. Each entity in the set represents an individual instance of the object or concept the entity set models.
Collection of Entities: An entity set consists of multiple entities of the same type. Each entity within the set is an individual instance or occurrence of the entity.
Attributes: All entities in an entity set share the same set of attributes, although the values of those attributes differ between individual entities.
Uniqueness: Each entity in an entity set is uniquely identifiable by a primary key or a set of attributes that collectively form a unique identifier.
Entity Set vs. Entity: An entity refers to a single object (e.g., a specific person or item), whereas an entity set refers to the collection of all similar entities (e.g., all people or all products). For example, the "Student" entity set might contain entities like Alice, Bob, and Charlie, each with specific attributes (StudentID, Name, etc.).
Let’s consider a simple example of a Student entity set. The Student entity set may include individual entities such as:
| StudentID | Name | Age | Address |
|---|---|---|---|
| 101 | Alice | 20 | 123 Main St. |
| 102 | Bob | 22 | 456 Elm St. |
| 103 | Charlie | 21 | 789 Oak St. |
Here, the Student entity set is a collection of all students, and each student is an instance of the Student entity. The Student entity set contains the attributes StudentID, Name, Age, and Address, but the values for these attributes will vary for each student.
Strong (Regular) Entity Sets:
StudentID uniquely identifies each student.Weak Entity Sets:
Identifying Attribute(s): The attribute(s) that uniquely identify each entity in an entity set are known as the primary key. In the Student entity set, StudentID could be the primary key.
Instances of an Entity Set: Each entity in an entity set is an instance that represents a specific occurrence of the entity. For example, "Alice" is an instance of the Student entity set.
Entity Set Cardinality: The cardinality of an entity set refers to the number of instances of that entity set. It can range from zero (no instances) to many (any number of instances). The cardinality can change over time as data is added or deleted.
Consider a University Database where we have the following entity sets:
Student:
StudentID, Name, Age, Major, EmailStudentIDCourse:
CourseID, CourseName, CreditsCourseIDInstructor:
InstructorID, Name, EmailInstructorIDDepartment:
DepartmentID, DepartmentName, BuildingDepartmentIDEntity sets are often related to one another in the ER model. These relationships are represented as diamonds and connect the respective entity sets. For instance:
An entity set is a fundamental concept in the ER model. It represents a collection of similar entities and forms the basis for designing a database schema. Understanding entity sets is key to properly structuring the data and establishing relationships between the data elements in the database design process.
Open this section to load past papers