Reputation: 135
Currently, I am reading Database System Concepts by Korth, Silberschantz, and Sudarhsan. I am not able to understand following paragraph.
A weak entity set can participate in relationships other than the identifying relationship. For instance, the payment entity could participate in a relationship with the account entity set, identifying the account from which the payment was made.
A weak entity set may participate as owner in an identifying relationship with another weak entity set. entity set.
It is also possible to have a weak entity set with more than one identifying A particular weak entity would then be identified by a combination of entities, one from each identifying entity set. The primary key of the weak entity set would consist of the union of the primary keys of the identifying entity sets, plus the discriminator of the weak entity set.
These important concepts are placed very compactly in a small paragraph. It is very difficult to interpret the meaning behind those concepts. Can anyone please help me understand? OR if you can provide links I can read it myself.
Upvotes: 0
Views: 547
Reputation: 29649
This is all a bit abstract - and I'm not sure you've copied every part of the original.
A "weak entity" is an entity that cannot exist outside the context of another. Classic examples are "order_lines" in a purchasing system, which only make sense in the context of an "orders" table.
A weak entity set can participate in relationships other than the identifying relationship. For instance, the payment entity could participate in a relationship with the account entity set, identifying the account from which the payment was made.
This means that while a weak entity must have an "identifying" relationship (in the example above, order_line must have an order_id relationship to its base table), it may also be associated with other entities, e.g "VAT rate" in the orderlines example. VAT rate is not_identifying_ - you cannot refer to the orderline as "that one line in the order with a VAT rate of 15%".
A weak entity set may participate as owner in an identifying relationship with another weak entity set. entity set.
This means that it is possible for a weak entity to be the "parent" of another weak entity - another entity makes no sense outside the parent. For instance, our purchase system might have a table called "order_line_discounts" which captures the discounts applied to each orderline. Those discounts make no sense without an orderline, and the orderline makes no sense without an order.
It is also possible to have a weak entity set with more than one identifying A particular weak entity would then be identified by a combination of entities, one from each identifying entity set. The primary key of the weak entity set would consist of the union of the primary keys of the identifying entity sets, plus the discriminator of the weak entity set.
This means that a weak entity may require more than one parent to make sense. If that happens, the primary key is made up of foreign keys to all the parents, plus (if necessary) an additional discriminator to uniquely identify that combination.
In our purchasing system, and order_line
is a weak entity related to orders
, but also to products
. An order may contain more than one row for a product, so the 'discriminator' would allow you to uniquely identify each order line.
Upvotes: 1