Skip to content
C

Weak Entity


Weak Entity

Definition

A weak entity is an entity that does not have enough attributes of its own to form a full primary key; it can only be uniquely identified by combining its partial key (also called a discriminator) with the primary key of another entity, called the owner (or identifying/strong) entity, to which it is linked via an identifying relationship (see 6.16).

Worked Example

Consider an Employee (strong entity, keyed by EmployeeID) and their `Dependent` (e.g., a spouse or child covered under insurance). A `Dependent` has attributes like Name and Relationship, but "Name" alone cannot uniquely identify a dependent across the whole company — many employees may have a dependent named "Raj". The `Dependent`'s partial key (Name) is only unique *within* one employee's dependents. So the true identifier of a Dependent is (EmployeeID, Dependent_Name) — the owner's key plus the partial key. If the Employee record is deleted, all of that employee's Dependent records must be deleted too, since they cannot exist without their owner.

Edge Cases

  • A weak entity always requires an identifying relationship with total participation on the weak entity's side — it must always exist through its owner, never in isolation (linking directly to 6.16 and 6.14).
  • The partial key is underlined with a dashed line in ER diagrams (vs. a solid underline for a full primary key); the weak entity itself is drawn as a double-line rectangle, and the identifying relationship as a double-line diamond.
  • Deleting the owner entity cascades to delete its weak entities — this is a defining structural/business rule, not optional.
  • Do not confuse a weak entity with a strong entity that merely participates totally in a relationship. A strong entity with total participation still has its own independent key; a weak entity structurally cannot be identified without the owner's key.

Key Takeaways / Interview Q&A

Q: What makes an entity "weak" — is it about how many attributes it has? A: No — a weak entity can have many attributes. "Weak" refers specifically to lacking a sufficient set of attributes to form a standalone unique key; it needs the owner's key too.

Q: How does a weak entity map to a relational table? A: The weak entity's table includes all its own attributes PLUS the owner entity's primary key as a foreign key; the table's primary key is the composite of (owner's key + partial key).

Q: Give another classic example of a weak entity besides Dependent. A: A Room within a Building (RoomNumber is only unique per building), or an `OrderItem/line-item that only makes sense in the context of a specific Order`.

Mock Test

  • Weak Entity - Quick Test

    8 questions on Weak Entity.

    8 questions · 8 min · Medium
    Start Mock Test