DBMS Notes
A weak entity is an entity that cannot be uniquely identified by its own attributes alone. It depends on another entity (called the identifying entity or...
What is a Weak Entity?
A weak entity is an entity that cannot be uniquely identified by its own attributes alone. It depends on another entity (called the identifying entity or owner entity) for its existence and identification. Without the owner, the weak entity has no meaning and cannot be distinguished from other instances.
The classic real-world analogy: a room number like "Room 301" is meaningless without knowing which building it belongs to. Two different buildings can both have a "Room 301." The room is a weak entity that depends on the building (owner entity) for unique identification.
ER Diagram Notation
| Element | Weak Entity Notation | Regular Entity Notation |
|---|---|---|
| Entity box | Double rectangle | Single rectangle |
| Identifying Relationship | Double diamond | Single diamond |
| Partial Key | Dashed underline | Solid underline (PK) |
| Participation | Double line (total) | Single line (partial allowed) |
The primary key of the weak entity DEPENDENT is: (EmpID, DepName) — combining the owner's key with the partial key.
Full Example — Employee and Dependents
Scenario: A company tracks employee dependents (family members) for insurance purposes. A dependent is identified by their name combined with the employee they belong to.
Employee Table (Strong Entity)
| EmpID | Name | Dept |
|---|---|---|
| E001 | Alice | CS |
| E002 | Bob | HR |
Primary Key: EmpID
Dependent Table (Weak Entity)
| EmpID | DepName | Relationship | DOB |
|---|---|---|---|
| E001 | Tom | Son | ... |
| E001 | Mary | Daughter | ... |
| E002 | John | Spouse | ... |
Primary Key: (EmpID, DepName). Partial Key: DepName. Foreign Key: EmpID → Employee.EmpID.
Notice that "Tom" appears twice — once as Alice's spouse and once as Bob's child. The partial key "DepName" alone cannot uniquely identify a dependent; we need EmpID + DepName together.
SQL Implementation
CREATE TABLE Employee (
emp_id VARCHAR(10) PRIMARY KEY,
name VARCHAR(100) NOT NULL,
dept VARCHAR(50),
salary DECIMAL(10,2)
);
CREATE TABLE Dependent (
emp_id VARCHAR(10),
dep_name VARCHAR(100),
relationship VARCHAR(20),
dob DATE,
PRIMARY KEY (emp_id, dep_name),
FOREIGN KEY (emp_id) REFERENCES Employee(emp_id) ON DELETE CASCADE
);The ON DELETE CASCADE enforces existence dependency — when an employee is deleted, all their dependents are automatically removed.
More Examples of Weak Entities
Example 2: Building and Room
| Building (Strong) | BuildingID, BuildingName, Address |
| Room (Weak) | BuildingID, RoomNumber, Capacity, Type |
| Key | Room is identified by (BuildingID, RoomNumber) |
Example 3: Bank Account and Transaction
Example 4: Course and CourseSection
| Course (Strong) | CourseID, Title, Credits |
| Section (Weak) | CourseID, SectionNum, Semester, Instructor |
| Key | (CourseID, SectionNum, Semester) |
Weak Entity vs. Strong Entity — Comparison
| Feature | Strong Entity | Weak Entity |
|---|---|---|
| Primary key | Has its own PK | Uses owner's PK + partial key |
| Independence | Exists independently | Depends on owner for existence |
| ER notation | Single rectangle | Double rectangle |
| Relationship | Normal (single diamond) | Identifying (double diamond) |
| Participation | Can be partial | Always total |
| Deletion | Independent | Cascaded with owner |
Identifying Relationship Properties
The identifying relationship has specific characteristics:
- Cardinality: Always 1:N (one owner to many weak entities)
- Weak entity participation: Always total (double line on weak entity side)
- Owner participation: Usually partial (an employee may have zero dependents)
- Notation: Double diamond in ER diagram
Can a Weak Entity Own Another Weak Entity?
Yes — this creates a chain of identification dependency:
| University | UnivID (PK) |
| Department | (UnivID, DeptCode) -- weak, depends on University |
| Course | (UnivID, DeptCode, CourseNum) -- weak, depends on Department |
The primary key grows longer at each level of the chain.
Common Exam Questions
Q: Can a weak entity have more than one owner? A: In the standard ER model, a weak entity has exactly one identifying relationship with one owner. However, some extended models allow identification through multiple relationships.
Q: Is a weak entity always on the "many" side? A: Yes — the identifying relationship is always 1:N (one owner has many weak entities). A 1:1 identifying relationship would mean the weak entity could simply use the owner's key as its own PK, making it effectively not weak.
Q: What happens when you delete the owner? A: All dependent weak entity instances must be deleted (CASCADE) because they cannot exist without identification through the owner.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Weak Entity Set.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Database Management Systems (DBMS) topic.
Search Terms
dbms, database management systems (dbms), unit, weak, entity, set, weak entity set
Related Database Management Systems (DBMS) Topics