Strong & Weak Entities
In the Entity-Relationship (ER) model of database design, entities are classified into two main categories: strong entities and weak entities. These distinctions help to define how entities are related and how they are represented in a database schema.
1. Strong Entity: A strong entity is an entity that has its attributes and can exist independently, even if it is not associated with any other entity. In other words, a strong entity has a primary key that uniquely identifies each instance of that entity. Strong entities are also referred to as regular entities.
Example of a Strong Entity: Consider an entity named "Student" in a university database. The "Student" entity is typically a strong entity because it has attributes such as "StudentID," "FirstName," "LastName," and "DateOfBirth." Each student can be uniquely identified by their "StudentID," and a student record can exist independently, even if there is no relationship with other entities.
2. Weak Entity: A weak entity is an entity that does not have a primary key attribute of its own or cannot exist independently. It relies on another entity, known as the "owner" or "parent" entity, for identification. Weak entities are typically associated with a relationship with a strong entity, which provides the necessary identification.
Example of a Weak Entity: Consider an entity named "Address" in a database that stores customer information for an e-commerce website. The "Address" entity might not have attributes that uniquely identify it, such as an address ID. Instead, it relies on the "Customer" entity for identification. Each customer can have multiple addresses (e.g., shipping address and billing address), and these addresses are specific to that customer.
In this case, "Address" is a weak entity, and "Customer" is the strong entity. The relationship between "Customer" and "Address" is important because it provides the necessary linkage. To uniquely identify an address, you might use a combination of the customer's ID and an address type (e.g., "Shipping Address" or "Billing Address").
In summary, strong entities have their attributes and can exist independently with a primary key, while weak entities rely on a strong entity for identification and typically don't have a primary key of their own. Understanding the distinction between these two types of entities is important for designing a well-structured and normalized database schema.
Last updated
Was this helpful?