What is Entity Set in DBMS?
An entity may be concrete (person) or abstract (job). An entity set in DBMS is a collection of similar entities. (All persons having an account at the bank). Entity sets need not be disjoint.
For example, the entity sets employees (all employees of a bank), and the entity set customers (all bank customers) may have members (Entity) in common. An entity is described using a set of attributes. Therefore, all entities in a given entity set have the same attributes. The entity set in DBMS is classified into two types:
- Weak entity set in DBMS
- Strong entity set in DBMS
Weak Entity Set in DBMS
A weak entity set in DBMS does not possess sufficient attributes to form a primary key. Instead, it depends on another entity called a weak entity. It is represented using a double rectangle which is as follows:
An example of a weak entity set in DBMS is as follows:
Dependents are an example of a weak entity set in DBMS. A weak entity in DBMS can be identified uniquely only by considering some of its attributes in conjunction with the primary key of another entity, which is called the identifying owner. In addition, the following restrictions must hold:
- The owner entity set and the weak entity set in DBMS must participate in a one-to-many relationship set (one owner entity is associated with one or more weak entities, but each weak entity has a single owner). This relationship set is called the identifying relationship set of the weak entity set in DBMS.
- The weak entity set in DBMS can have total participation in the identifying relationship set.
For example, a dependents entity can be identified uniquely only if we take the key of the owning Employees entity and the pname of the dependents entity. The set of attributes of the weak entity set in DBMS that uniquely identify a weak entity for a given owner entity is called a partial key of the weak entity set. In our example, pname is a partial key for dependents,
The dependents weak entity set and its relationship to employees are shown in the figure. The total participation of dependents in policy is indicated by linking them with a double line. The arrow from policy to dependents indicates that each dependents entity appears in at most one (indeed, exactly one, because of the participation constraint) policy relationship. We draw both with double lines to underscore that dependents are a weak entity and policy is its identifying relationship. We underline it using a broken line to indicate that pname is a partial key for dependents. This means that there may be two dependents with the same pname value.
Strong Entity Set in DBMS
A strong entity set in DBMS is an entity set that contains sufficient attributes to identify all its entities uniquely. In other words, a primary key exists for the strong entity set in DBMS. The primary key of the strong entity set in DBMS is represented by underlining it.
A strong entity set in DBMS possesses its primary key. It is represented using a single rectangle. A diamond represents the relationship between two strong entities. A set of strong entities in DBMS is known as a strong entity set in DBMS.
Example of a strong entity set in DBMS:
Consider an organization as an example: a manager, a product, an employee, a department, and so on can all be considered separate entities.