03 Aralık 2018

https://www.cs.sfu.ca/CourseCentral/354/zaiane/material/postscript/Chapter2.pdf

 Attributes
It is possible to de ne a set of entities and the relationships among them in a number of di erent ways. The main difference is in how we deal with attributes.
Consider the entity set employee with attributes employee-name and phone-number.
We could argue that the phone be treated as an entity itself, with attributes phone-number and location.
Then we have two entity sets, and the relationship set EmpPhn de ning the association between employees and their phones.
This new de nition allows employees to have several (or zero) phones.
New de nition may more accurately re ect the real world.

Mapping Cardinalities: express the number of entities to which another entity can be associated via a relationship. For binary relationship sets between entity sets A and B, the mapping cardinality must be one of:
1. One-to-one: An entity in A is associated with at most one entity in B, and an entity in B is associated with at most one entity in A. (Figure 2.3)
2. One-to-many: An entity in A is associated with any number in B. An entity in B is associated with at most one entity in A. (Figure 2.4)
3. Many-to-one: An entity in A is associated with at most one entity in B. An entity in B is associated with any number in A. (Figure 2.5)
4. Many-to-many: Entities in A and B are associated with any number from each other.

Existence Dependencies:
if the existence of entity X depends on the existence of entity Y, then X is said to be existence dependent on Y.
(Or we say that Y is the dominant entity and X is the subordinate entity.)
For example,
{ Consider account and transaction entity sets, and a relationship log between them.
{ This is one-to-many from account to transaction.
{ If an account entity is deleted, its associated transaction entities must also be deleted.
{ Thus account is dominant and transaction is subordinate.

Hiç yorum yok: