Skip to content
C

Entity Set


Entity Set

Definition

An entity set is the collection of all entities of the same type that share the same set of attributes. It corresponds to the "entity type" in the ER model — a template or category — as opposed to any one occurrence of it. In an ER diagram, an entity set is drawn as a single rectangle labeled with the type name (e.g., "Student"), while every actual student is one member of that set.

Worked Example

Student is an entity set containing every student entity: Aditi Sharma, Rohan Verma, and so on. Likewise Course, Department, and Faculty are each entity sets in the college database. All entities within the Student entity set share the same attributes — Roll_No, Name, DOB, Email — even though the values differ from student to student.

Edge Cases

  • An entity set is analogous to a relation (table) in the relational model; an individual entity is analogous to a tuple (row). This mapping is central to ER-to-relational conversion (see topic 6.21).
  • Two different entity sets can share some attribute names (both Student and Faculty might have a Name and Email) but they remain separate entity sets because their overall attribute structure and identity are different.
  • An entity set can be empty (zero current members) and still be validly defined — e.g., a Course entity set for a brand-new course catalog with no enrolled sections yet.
  • A weak entity set (see 6.4) is a special kind of entity set that lacks a full primary key of its own and is defined in terms of another entity set.

Key Takeaways / Interview Q&A

Q: How is an entity set represented in an ER diagram? A: As a rectangle, with the entity set's name inside it; its attributes are attached as ovals (or listed inside the box in simplified notations).

Q: What is the relationship between an entity set and a relational table? A: When mapping ER to relational schema, a (strong) entity set typically becomes one table, its attributes become columns, and each entity becomes one row.

Q: Can one entity belong to more than one entity set at the same time? A: In the classical ER model, yes conceptually (e.g., a person could be both in Student and Faculty if they are a teaching assistant), though this is usually handled cleanly with generalization/specialization (see 6.17/6.18) rather than ad-hoc overlap.

Mock Test

  • Entity Set - Quick Test

    8 questions on Entity Set.

    8 questions · 8 min · Medium
    Start Mock Test