Every entity we have designed so far could identify itself. A student has a roll number, an employee has an employee ID, a department has a department code. Give the DBMS that one value, and it knows exactly which entity you mean.
But some things in the real world do not have such an identity of their own. Think of the dependents (children, spouse, parents) listed in an employee's insurance record. Two different employees may both have a daughter named "Aditi". The name alone does not tell you which Aditi you mean. You only know once you also say whose daughter she is.
Entities like this are called weak entities. In this chapter, we will learn what makes an entity weak, how weak entities are identified, how they are drawn, and how they behave when they finally become tables.
Strong vs Weak Entity Types
A strong entity type has a key attribute of its own, so each entity can be uniquely identified independently.
A weak entity type does not have a key attribute of its own. Its entities are identified by being related to specific entities of another entity type, called the owner (or identifying) entity type, combined with some of their own attribute values.
Three new terms come with weak entities:
Term | Meaning | Example |
|---|---|---|
Owner / identifying entity type | The strong entity type that "owns" the weak entity | EMPLOYEE |
Identifying relationship | The relationship that connects the weak entity to its owner | HAS_DEPENDENT |
Partial key (discriminator) | The attribute(s) that distinguish weak entities belonging to the same owner | dep_name |
The full identity of a weak entity is:
Key of weak entity = Primary key of owner + Partial key of weak entity
Key of DEPENDENT = emp_id + dep_nameWhy Weak Entities Exist: An Example
Suppose a company stores dependents for insurance:
Employee 2 (Priya) → dependents: Aditi (daughter), Ravi (spouse)
Employee 8 (Meera) → dependents: Aditi (daughter), Suresh (father)Let's try to find a key for DEPENDENT using only its own attributes:
dep_name? No. There are two Aditis.dep_name + relation? No. Both Aditis are daughters.dep_name + birth_date? Probably unique in practice, but it is not guaranteed, and many dependents have no recorded birth date.
There is no natural key. But within one employee, dependent names are unique (an employee will not list two dependents with exactly the same name). So:
(2, Aditi)identifies Priya's daughter.(8, Aditi)identifies Meera's daughter.
DEPENDENT is a weak entity type, EMPLOYEE is its owner, and dep_name is its partial key.
There is a second reason dependents are "weak": a dependent only matters because of the employee. If the employee leaves the company, their dependents' insurance records have no reason to exist. This is called existence dependency.
Properties of a Weak Entity
Every weak entity type has these properties:
No key of its own, only a partial key (it may even have no partial key, if each owner can have at most one such weak entity).
Identified through an identifying relationship with an owner entity type.
Total participation in the identifying relationship. A dependent without an employee cannot be identified, so every weak entity must be related to an owner.
The identifying relationship is 1:N (or 1:1) from owner to weak entity. One employee can have many dependents, but each dependent belongs to exactly one owning employee.
Existence dependency: if the owner is deleted, its weak entities must be deleted too.
Notation in ER Diagrams
Element | Chen Symbol |
|---|---|
Weak entity type | Double rectangle |
Identifying relationship | Double diamond |
Partial key | Attribute name with a dashed underline |
Weak entity's participation | Double line (total) |
In the text diagrams on this site, _x_ marks a key attribute and ~x~ marks a partial key (standing in for the dashed underline):
( _emp_id_ ) ( name ) ( ~dep_name~ ) ( relation )
\ / \ /
[ EMPLOYEE ]──1──<< HAS_DEPENDENT >>══N══[[ DEPENDENT ]]
|
( birth_date )
[[ ]] double rectangle = weak entity
<< >> double diamond = identifying relationship
══ double line = total participation of DEPENDENT
~ ~ dashed underline = partial keyRead it as: "Each DEPENDENT is identified by its owning EMPLOYEE plus its dep_name; every dependent must belong to exactly one employee; an employee may have many dependents (or none)."
Note that EMPLOYEE's participation is partial (single line): an employee need not have any dependents.
More Examples of Weak Entities
Owner (Strong) | Weak Entity | Partial Key | Full Key |
|---|---|---|---|
EMPLOYEE | DEPENDENT | dep_name | (emp_id, dep_name) |
BUILDING | ROOM | room_no | (building_id, room_no) |
LOAN | PAYMENT (installment) | payment_no | (loan_id, payment_no) |
ORDER | ORDER_LINE | line_no | (order_id, line_no) |
COURSE | SECTION | (sec_id, semester, year) | (course_id, sec_id, semester, year) |
HOTEL | ROOM | room_no | (hotel_id, room_no) |
The pattern is always the same: the partial key is unique only within one owner. Room 101 exists in many buildings; installment no. 3 exists for every loan; line no. 1 exists in every order.
Worked Example: Loan Payments
LOAN PAYMENT (weak)
+---------+--------+ +---------+------------+-------------+--------+
| loan_id | amount | | loan_id | payment_no | paid_on | amount |
+---------+--------+ +---------+------------+-------------+--------+
| L-17 | 50000 | | L-17 | 1 | 2025-01-05 | 5000 |
| L-23 | 80000 | | L-17 | 2 | 2025-02-05 | 5000 |
+---------+--------+ | L-23 | 1 | 2025-01-10 | 8000 |
+---------+------------+-------------+--------+payment_no = 1 appears twice, so it is not a key. (loan_id, payment_no) is. And a payment of a loan that does not exist makes no sense, so PAYMENT totally depends on LOAN.
From Weak Entity to Table (Preview)
The full mapping rules are in Converting ER Diagrams to Tables, but here is a short preview because it shows why the weak entity concept is useful.
The weak entity becomes a table that includes:
the owner's primary key as a foreign key,
the partial key and other attributes,
a primary key = owner key + partial key,
usually
ON DELETE CASCADEon the foreign key, to enforce existence dependency.
Here it is in MySQL 8.4, run on a copy of the sample company database:
CREATE TABLE dependents (
emp_id INT,
dep_name VARCHAR(50),
relation VARCHAR(20) NOT NULL,
birth_date DATE,
PRIMARY KEY (emp_id, dep_name),
FOREIGN KEY (emp_id) REFERENCES employees(emp_id) ON DELETE CASCADE
);
INSERT INTO dependents VALUES
(2, 'Aditi', 'Daughter', '2016-05-10'),
(2, 'Ravi', 'Spouse', '1990-11-02'),
(8, 'Aditi', 'Daughter', '2019-08-21'),
(8, 'Suresh', 'Father', '1962-03-15');
SELECT * FROM dependents ORDER BY emp_id, dep_name;+--------+----------+----------+------------+
| emp_id | dep_name | relation | birth_date |
+--------+----------+----------+------------+
| 2 | Aditi | Daughter | 2016-05-10 |
| 2 | Ravi | Spouse | 1990-11-02 |
| 8 | Aditi | Daughter | 2019-08-21 |
| 8 | Suresh | Father | 1962-03-15 |
+--------+----------+----------+------------+Two Aditis are fine, because they belong to different employees. But a second Aditi for the same employee is rejected:
INSERT INTO dependents VALUES (2, 'Aditi', 'Niece', NULL);ERROR 1062 (23000): Duplicate entry '2-Aditi' for key 'dependents.PRIMARY'Now the existence dependency. Meera Nair (emp 8) leaves the company. (No one reports to Meera, so no other employee row refers to her.)
DELETE FROM employees WHERE emp_id = 8;
SELECT * FROM dependents ORDER BY emp_id, dep_name;+--------+----------+----------+------------+
| emp_id | dep_name | relation | birth_date |
+--------+----------+----------+------------+
| 2 | Aditi | Daughter | 2016-05-10 |
| 2 | Ravi | Spouse | 1990-11-02 |
+--------+----------+----------+------------+Meera's dependents disappeared automatically, exactly as existence dependency demands. The identifying relationship HAS_DEPENDENT itself did not need a separate table; the foreign key emp_id inside dependents represents it.
Existence Dependency vs Identification Dependency
This is a subtle point that good interviewers like to probe.
Every weak entity is existence-dependent on its owner (total participation).
But not every existence-dependent entity is weak.
Example: a DRIVING_LICENCE cannot exist without a PERSON, so it is existence-dependent. But every licence has its own unique licence number, so it can be identified on its own. It is a strong entity with total participation in a relationship, not a weak entity.
Entity | Needs another entity to exist? | Needs another entity to be identified? | Weak? |
|---|---|---|---|
DEPENDENT | Yes | Yes | Yes |
DRIVING_LICENCE | Yes | No (has licence_no) | No |
STUDENT | No | No | No |
So the defining feature of a weak entity is identification dependency, not just existence dependency.
Some Less Common Cases
Weak entity owned by a weak entity. A BUILDING has ROOMs (weak), and each room has BEDs numbered 1, 2, 3 (weak, owned by ROOM). The key of BED becomes (building_id, room_no, bed_no).
More than one owner. The identifying relationship can involve more than one owner. Example: an INTERVIEW identified by the CANDIDATE, the COMPANY and the interview date. The weak entity's key then includes the keys of all owners.
No partial key at all. If an owner can have at most one weak entity of that type (a 1:1 identifying relationship), the owner's key alone identifies it.
Weak Entity or Something Else?
Weak entities are a modelling choice, not a law of nature. The same data can sometimes be modelled differently:
As a multivalued composite attribute. If dependents have no relationships of their own and are only ever looked at together with their employee, DEPENDENT could be a multivalued composite attribute
{dependent(name, relation, birth_date)}of EMPLOYEE. Both designs end up as almost the same table: a separate table holdingemp_idplus the dependent details.As a strong entity with a surrogate key. Many real systems give every row its own ID (e.g., an auto-increment
dependent_id). Then DEPENDENT is technically strong. This is simpler for ORMs and APIs, but you lose the "unique per owner" rule unless you add a separateUNIQUE (emp_id, dep_name)constraint.
Prefer the weak-entity design when the weak entity takes part in other relationships or has many attributes, and when its identity naturally depends on its owner (rooms in a building, lines in an order).
Strong vs Weak Entity: Comparison
Point | Strong Entity | Weak Entity |
|---|---|---|
Own key | Yes (primary key) | No, only a partial key (discriminator) |
Identified by | Its own key | Owner's key + partial key |
Depends on another entity | No | Yes, on the owner (existence and identification) |
ER symbol | Single rectangle | Double rectangle |
Relationship to owner | Normal relationship (single diamond) | Identifying relationship (double diamond) |
Participation | Total or partial | Always total in the identifying relationship |
Key notation | Solid underline | Dashed underline (partial key) |
Table's primary key | Its own key | Owner's PK + partial key (composite) |
Common Mistakes
Calling the partial key a primary key.
dep_namealone is not unique; only (emp_id, dep_name) is.Drawing the weak entity with a single line to the identifying relationship. Its participation is always total, so it must be a double line.
Making the identifying relationship M:N. Each weak entity has exactly one owner (per owner type), so the identifying relationship is 1:N or 1:1 from owner to weak entity.
Thinking total participation means "weak". DRIVING_LICENCE is existence-dependent but strong, because it has its own key.
Adding the owner's key as an attribute in the ER diagram. In the ER diagram, the link comes from the identifying relationship;
emp_idappears in the weak entity only after conversion to a table.Forgetting ON DELETE CASCADE (or an equivalent rule) when converting, leaving orphan weak-entity rows or blocking owner deletion unexpectedly.
Interview Questions
What is a weak entity? Give an example.
An entity type that has no key attribute of its own and is identified by its relationship to an owner entity plus a partial key. Example: DEPENDENT of EMPLOYEE, identified by (emp_id, dep_name).
What is a partial key (discriminator)?
The attribute or set of attributes that uniquely identifies weak entities among those related to the same owner entity. It is shown with a dashed underline.
What is an identifying relationship?
The relationship between a weak entity type and its owner, through which the weak entity gets its identity. It is drawn as a double diamond, and the weak entity has total participation in it.
What is the primary key of a weak entity's table?
The primary key of the owner entity (as a foreign key) combined with the partial key of the weak entity.
Why must a weak entity have total participation in its identifying relationship?
Because it cannot be identified without its owner. A weak entity with no owner would have only a partial key, which is not unique.
Is every existence-dependent entity a weak entity?
No. An entity can be unable to exist without another (like a driving licence without a person) and still have its own key. Weak entities are defined by identification dependency.
What is the cardinality of an identifying relationship?
1:N or 1:1 from the owner to the weak entity: an owner can have many weak entities, but each weak entity has exactly one owner.
How does a database enforce existence dependency for a weak entity?
With a NOT NULL foreign key to the owner that is part of the primary key, usually with ON DELETE CASCADE so that deleting the owner deletes its weak entities.
Summary
A weak entity has no key of its own. It is identified by its owner's key plus its partial key (discriminator).
It is linked to its owner through an identifying relationship (double diamond), in which it always has total participation (double line). The owner side is 1.
Drawn as a double rectangle; the partial key has a dashed underline.
Typical examples: dependents of employees, rooms of buildings, payments of loans, lines of orders.
In tables: PK = owner PK + partial key, FK to the owner, usually ON DELETE CASCADE.
Every weak entity is existence-dependent, but not every existence-dependent entity is weak.
So far, every entity type has stood on its own. In the next chapter, Generalization, Specialization & Aggregation, we will see how entity types can form hierarchies (a FACULTY and a STAFF are both EMPLOYEEs) and how a relationship can itself be treated like an entity.