About Lesson
Key Differences Between Strong Entity and Weak Entity
Feature | Strong Entity | Weak Entity |
---|---|---|
Primary Key Existence | Has a primary key that uniquely identifies each instance. | May not have a primary key, or it may have a partial key that identifies instances only within the context of the owning strong entity. |
Independence | Exists independently of other entities. | Depends on the existence of a related strong entity (owner) for identification. |
Attributes | Has a set of attributes that uniquely identify instances. | Typically has a partial key that, combined with the owning entity’s primary key, forms a composite key. May also have additional non-key attributes. |
Table Representation | Represented by a standalone table in the database. | Usually represented in the same table as the owning strong entity, often as a separate section within that table. |
Differences Between Strong Entity and Weak Entity Using Example:
Strong Entity:
| StudentID (PK) | Name | Age | Major |
|----------------|-----------|---------|----------|
| 101 | Alice | 20 | Math |
| 102 | Bob | 22 | Physics |
| 103 | Carol | 21 | English |
In this example, “Student” is a strong entity with the primary key attribute “StudentID” uniquely identifying each student.
Weak Entity:
| StudentID (FK) | CourseID (FK) | Grade |
|----------------|---------------|-----------|
| 101 | 201 | A |
| 102 | 202 | B |
| 103 | 203 | A- |
In this example, “Course Enrollment” is a weak entity that relies on the combination of “StudentID” (foreign key referring to the “Student” entity) and “CourseID” (foreign key referring to the “Course” entity) to uniquely identify each enrollment. The combination of these attributes acts as a composite or partial key.
In summary:
- Strong entities can be uniquely identified by their own attributes and have a primary key.
- Weak entities cannot be uniquely identified by their attributes alone and depend on a related strong (parent) entity for identification, typically through a discriminator and the parent’s key.