Sei sulla pagina 1di 2

Existence Dependency:

An existence constraint or existence dependency can occur between two entities. The term existence dependency means that an instance of one entity cannot exist without the existence of an instance of the other (related) entity.

Weak Entity and Strong Entity:


An entity type that has an existence dependency is called weak entity. Thus, an instance of a weak entity cannot exist independently but depends on the existence of another entity (strong entity) instance. The weak entity is also referred to as child, or dependent or subordinate. In E-R diagram, the existence dependency of weak entity is indicated by double line rectangle. An entity type that has no existence dependency is called strong entity. It can exist without depending upon the existence of another entity. The strong entity is also referred to as parent, or owner, or dominant. Examples: The following examples clear the concept of weak and strong entities. 1. Suppose A and B are two entity types. If each instance of B must have a corresponding instance of A, we say that the existence of B is dependent on A. It means that an instance of B cannot exist without some instance of A. If the instance of A is dropped from database, the instance of B must be dropped as well. Thus, entity A is referred to as the strong entity, whereas entity B is referred to as weak entity. 2. In a college/university, a FACULTY entity is existence dependent on a DEPARTMENT entity. It means that a faculty member cannot exist without a corresponding DEPARTMENT. A faculty member is never allowed to "float free" in the database without a corresponding department. A figure is shown below, representing the existence dependency between DEPARTMENT and FACULTY.

Identifier Dependency
A special type of existence dependency occurs when the weak entity set does not have a candidate key, and its instances are indistinguishable without a relationship with another entity.

Referential Dependency:
Another special type of existence dependency, called the referential dependency, which occurs when a weak entity contains a foreign key ( the primary key of the corresponding strong entity ). This leads to an important type of constraint called a referential constraint. It states that a value of a foreign key attribute in the weak entity instance must always be equal to the value of the primary key of an associated strong entity instance. For example, if DeptName is an attribute of the FACULTY entity and this entity is existence dependent on DEPARTMENT entity, then DeptName is a foreign key for FACULTY. On the other hand, DeptName is the primary key of the DEPARTMENT entity. So according to referential dependency, the value of DeptName for every instance of FACULTY entity must match the value of DeptName in some instance of DEPARTMENT entity. Figure below shows, E-R diagram with referential dependency of FACULTY on DEPARTMENT.

Potrebbero piacerti anche